version 1.106, 2009/11/23 14:37:50
|
version 1.109, 2010/01/27 13:08:01
|
Line 1210 sub delete_group {
|
Line 1210 sub delete_group {
|
if ($result eq 'ok') { |
if ($result eq 'ok') { |
my $outcome = &modify_folders($cdom,$cnum,$groupname,$crstype); |
my $outcome = &modify_folders($cdom,$cnum,$groupname,$crstype); |
if ($outcome eq '') { |
if ($outcome eq '') { |
$r->print('<div class="LC_success">' |
my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Group successfully deleted.')); |
.&mt('Group successfully deleted.') |
$message = &Apache::loncommon::confirmwrapper($message); |
.'</div>'); |
$r->print($message); |
} else { |
} else { |
$r->print('<div class="LC_error">'); |
$r->print('<div class="LC_error">'); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
Line 1223 sub delete_group {
|
Line 1223 sub delete_group {
|
$r->print('</div>'); |
$r->print('</div>'); |
} |
} |
} else { |
} else { |
$r->print('<div class="LC_error">' |
my $msg = &Apache::lonhtmlcommon::confirm_success(&mt('Group deletion failed.'),1); |
.&mt('Group deletion failed.') |
$msg = &Apache::loncommon::confirmwrapper($msg); |
.'</div>'); |
$r->print($msg); |
} |
} |
} |
} |
return; |
return; |
Line 1437 $context) eq 'ok') {
|
Line 1437 $context) eq 'ok') {
|
} |
} |
my $outcome = &reenable_folder($cdom,$cnum,$groupname,$description,$crstype); |
my $outcome = &reenable_folder($cdom,$cnum,$groupname,$description,$crstype); |
if ($outcome eq '') { |
if ($outcome eq '') { |
$r->print('<div class="LC_success">' |
my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Group successfully re-enabled.')); |
.&mt('Group successfully re-enabled.') |
$message = &Apache::loncommon::confirmwrapper($message); |
.'</div>'); |
$r->print($message); |
} else { |
} else { |
$r->print('<div class="LC_error">'); |
$r->print('<div class="LC_error">'); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
Line 1450 $context) eq 'ok') {
|
Line 1450 $context) eq 'ok') {
|
$r->print('</div>'); |
$r->print('</div>'); |
} |
} |
} else { |
} else { |
$r->print('<div class="LC_error">' |
my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling group failed.'),1); |
.&mt('Re-enabling group failed.') |
$message = &Apache::loncommon::confirmwrapper($message); |
.'</div>'); |
$r->print($message); |
} |
} |
return; |
return; |
} |
} |
Line 1774 sub membership_options {
|
Line 1774 sub membership_options {
|
'picr' => 'Pick the criteria to use to build a list of course users from which you will select members of the new group.', |
'picr' => 'Pick the criteria to use to build a list of course users from which you will select members of the new group.', |
'pica' => 'Pick the criteria to use to build a list of course users from which you will select additional members of the group.', |
'pica' => 'Pick the criteria to use to build a list of course users from which you will select additional members of the group.', |
'ifno' => 'If you do not wish to add members when you first create the group, there is no need to pick any criteria.', |
'ifno' => 'If you do not wish to add members when you first create the group, there is no need to pick any criteria.', |
'asub' => 'A subsequent step will also allow you to specify automatic adding/dropping of group members triggered by specified user role and section <i>changes</i> in the course.', |
|
'acty' => 'Access types', |
'acty' => 'Access types', |
'coro' => 'Course roles', |
'coro' => 'Course roles', |
'cose' => 'Course sections', |
'cose' => 'Course sections', |
Line 2337 sub default_privileges {
|
Line 2336 sub default_privileges {
|
&Apache::lonhtmlcommon::row_title($lt{'func'},undef, |
&Apache::lonhtmlcommon::row_title($lt{'func'},undef, |
'LC_groups_functionality')); |
'LC_groups_functionality')); |
my @tableHeader; |
my @tableHeader; |
foreach my $key (sort(keys(%{$functions}))){ |
if ((ref($functions) eq 'HASH') && (ref($tools) eq 'ARRAY')) { |
push (@tableHeader,&mt($functions->{$key})); |
@tableHeader = map { $functions->{$_}; } @{$tools}; |
} |
} |
$r->print(join('</td><td class="LC_groups_functionality">', @tableHeader)); |
$r->print(join('</td><td class="LC_groups_functionality">', @tableHeader)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
my $fixed = ''; |
my $fixed = ''; |
Line 3244 sub write_group_data {
|
Line 3243 sub write_group_data {
|
$description,$tools,\%groupinfo, |
$description,$tools,\%groupinfo, |
$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$r->print('<div class="LC_success">' |
my $msg = &Apache::lonhtmlcommon::confirm_success(&mt($ucgpterm.' [_1] was created.','<i>'.$groupname.'</i>')); |
.&mt($ucgpterm.' [_1] was created.','<i>'.$groupname.'</i>') |
$msg = &Apache::loncommon::confirmwrapper($msg); |
.'</div>'); |
$r->print($msg); |
} else { |
} else { |
$r->print('<div class="LC_error">' |
my $msg = &Apache::lonhtmlcommon::confirm_success(&mt('A problem occurred when creating folders for the new '.$gpterm.' [_1]:' |
.&mt('A problem occurred when creating folders for the new '.$gpterm.' [_1]:' |
,'<i>'.$groupname.'</i>') |
,'<i>'.$groupname.'</i>') |
.'<br />'.$result,1); |
.'<br />'.$result |
$msg = &Apache::loncommon::confirmwrapper($msg); |
.'</div>'); |
$r->print($msg); |
} |
} |
} elsif ($action eq 'modify') { |
} elsif ($action eq 'modify') { |
my (@oldtools,@newtools); |
my (@oldtools,@newtools); |
Line 3323 sub write_group_data {
|
Line 3322 sub write_group_data {
|
$r->print('<div class="LC_error">'.$error.'</div>'); |
$r->print('<div class="LC_error">'.$error.'</div>'); |
} |
} |
} |
} |
$r->print('<div class="LC_success">' |
my $message = &Apache::lonhtmlcommon::confirm_success(&mt($ucgpterm.' [_1] was updated.','<i>'.$groupname.'</i>')); |
.&mt($ucgpterm.' [_1] was updated.','<i>'.$groupname.'</i>') |
$message = &Apache::loncommon::confirmwrapper($message); |
.'</div>'); |
$r->print($message); |
} |
} |
} else { |
} else { |
my %actiontype = ( |
my %actiontype = ( |
Line 3503 sub process_membership {
|
Line 3502 sub process_membership {
|
my $roster_result = &Apache::lonnet::modify_coursegroup_membership($cdom, |
my $roster_result = &Apache::lonnet::modify_coursegroup_membership($cdom, |
$cnum,\%usersettings); |
$cnum,\%usersettings); |
if ($num_ok) { |
if ($num_ok) { |
foreach my $type (sort(keys(%added))) { |
my $msgall =''; |
$r->print(&mt('The following users were successfully [_1]',$type)); |
foreach my $type (sort(keys(%added))) { |
|
my $message = &mt('The following users were successfully [_1]',$type); |
if (!($type eq 'deleted' || $type eq 'expired')) { |
if (!($type eq 'deleted' || $type eq 'expired')) { |
$r->print(&mt(' with the following privileges')); |
$message .= &mt(' with the following privileges'); |
} |
} |
$r->print(':<br />'); |
$message .= ':<br/>'; |
foreach my $user (@{$added{$type}}) { |
foreach my $user (@{$added{$type}}) { |
my $privlist = ''; |
my $privlist = ''; |
if (!($type eq 'deleted' || $type eq 'expired')) { |
if (!($type eq 'deleted' || $type eq 'expired')) { |
Line 3524 sub process_membership {
|
Line 3524 sub process_membership {
|
} |
} |
$privlist =~ s/, $//; |
$privlist =~ s/, $//; |
} |
} |
$r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.$privlist.'<br />'); |
$message .= $$userdata{$user}[$$idx{fullname}].' - '.$user.$privlist.'<br />'; |
} |
} |
$r->print('<br />'); |
$message .= '<br/>'; |
|
$message = &Apache::lonhtmlcommon::confirm_success($message); |
|
$msgall .= $message; |
} |
} |
|
$msgall = &Apache::loncommon::confirmwrapper($msgall); |
|
$r->print($msgall); |
} |
} |
if ($num_fail) { |
if ($num_fail) { |
foreach my $type (sort(keys(%failed))) { |
foreach my $type (sort(keys(%failed))) { |
Line 3540 sub process_membership {
|
Line 3544 sub process_membership {
|
} |
} |
$r->print('<br />'); |
$r->print('<br />'); |
} |
} |
if (@unchanged > 0) { |
# Is that really needed? |
$r->print(&mt('No change occurred for the following users:').'<br />'); |
# |
foreach my $user (sort(@unchanged)) { |
# if (@unchanged > 0) { |
$r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />'); |
# $r->print(&mt('No change occurred for the following users:').'<br />'); |
} |
# foreach my $user (sort(@unchanged)) { |
$r->print('<br />'); |
# $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />'); |
} |
# } |
|
# $r->print('<br />'); |
|
# } |
if ($roster_result eq 'ok') { |
if ($roster_result eq 'ok') { |
$r->print('<div class="LC_success">' |
$r->print('<div class="LC_success">' |
.&mt($ucgpterm.' membership list updated.') |
.&mt($ucgpterm.' membership list updated.') |