version 1.47, 2006/07/07 21:04:57
|
version 1.63, 2006/11/02 21:06:06
|
Line 29 package Apache::loncoursegroups;
|
Line 29 package Apache::loncoursegroups;
|
|
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon; |
use Apache::loncommon(); |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnavmaps; |
use Apache::lonnavmaps(); |
use Apache::longroup; |
use Apache::longroup(); |
use Apache::portfolio; |
use Apache::portfolio(); |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
|
use LONCAPA::map(); |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
|
|
Line 59 sub handler {
|
Line 60 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','refpage','state','groupname','branch']); |
['action','refpage','state','groupname','branch']); |
my $function = &Apache::loncommon::get_users_function(); |
|
my $tabcol = &Apache::loncommon::designparm($function.'.tabbg'); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
my $view_permission = |
my $view_permission = |
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}); |
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
my $manage_permission = |
my $manage_permission = |
&Apache::lonnet::allowed('mdg',$env{'request.course.id'}); |
&Apache::lonnet::allowed('mdg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
|
my $gpterm = &Apache::loncommon::group_term(); |
my $gpterm = &Apache::loncommon::group_term(); |
Line 91 sub handler {
|
Line 90 sub handler {
|
$idx{uname} = &Apache::loncoursedata::CL_SNAME(); |
$idx{uname} = &Apache::loncoursedata::CL_SNAME(); |
$idx{section} = &Apache::loncoursedata::CL_SECTION(); |
$idx{section} = &Apache::loncoursedata::CL_SECTION(); |
|
|
my $rowColor1 = "#dddddd"; |
|
my $rowColor2 = "#eeeeee"; |
|
|
|
my $action = $env{'form.action'}; |
my $action = $env{'form.action'}; |
my $state = $env{'form.state'}; |
my $state = $env{'form.state'}; |
if ((!defined($action)) || ($action eq 'view')) { |
if ((!defined($action)) || ($action eq 'view') || ($action eq 'modify')) { |
if (!defined($state)) { |
if (!defined($state)) { |
$state = 'view'; |
$state = 'view'; |
} |
} |
} |
} |
if ($action eq 'create' || $action eq 'modify' || $action eq 'view') { |
if ($action eq 'create' || $action eq 'modify' || $action eq 'view') { |
if ($view_permission || $manage_permission) { |
if ($view_permission || $manage_permission) { |
&group_administration($r,$action,$state,$cdom,$cnum, |
if ($state eq 'view') { |
$tabcol,\%functions,\%idx,$view_permission, |
&print_main_menu($r,$cdom,$cnum,\%functions,\%idx, |
$manage_permission,$rowColor1,$rowColor2, |
$view_permission,$manage_permission, |
$gpterm,$ucgpterm,$crstype); |
$action,$state,$gpterm,$ucgpterm,$crstype); |
|
} else { |
|
&group_administration($r,$action,$state,$cdom,$cnum, |
|
\%functions,\%idx,$view_permission, |
|
$manage_permission,$gpterm,$ucgpterm, |
|
$crstype); |
|
} |
} else { |
} else { |
$r->print(&mt('You do not have [_1] administration '. |
$r->print(&mt('You do not have [_1] administration '. |
'privileges in this [_2]',$gpterm,lc($crstype))); |
'privileges in this [_2]',$gpterm,lc($crstype))); |
Line 122 sub handler {
|
Line 124 sub handler {
|
sub print_main_menu { |
sub print_main_menu { |
my ($r,$cdom,$cnum,$functions,$idx,$view_permission,$manage_permission, |
my ($r,$cdom,$cnum,$functions,$idx,$view_permission,$manage_permission, |
$action,$state,$gpterm,$ucgpterm,$crstype) = @_; |
$action,$state,$gpterm,$ucgpterm,$crstype) = @_; |
my $pagename = "$crstype $ucgpterm".'s'; |
|
my $jscript = qq| |
my $jscript = qq| |
function changeSort(caller) { |
function changeSort(caller) { |
document.$state.sortby.value = caller; |
document.$state.sortby.value = caller; |
document.$state.submit(); |
document.$state.submit(); |
|
} |
|
function openGroupRoster(group,status) { |
|
var url = '/adm/grouproster?'; |
|
url += 'group='+group+'&status='+status+'&ref=popup'; |
|
var title = 'Group Membership'; |
|
var options = 'scrollbars=1,resizable=1,menubar=0'; |
|
options += ',width=700,height=600'; |
|
rosterbrowser = open(url,title,options,'1'); |
|
rosterbrowser.focus(); |
}\n|; |
}\n|; |
$r->print(&header($pagename,$jscript,$action,$state)); |
$r->print(&header('Groups',$jscript,$action,$state)); |
|
if ($env{'form.refpage'} eq 'enrl') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/dropadd", |
|
text=>"Enrollment Manager"}); |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/coursegroups", |
({href=>"/adm/coursegroups", |
text=>"$pagename"}); |
text=>"Groups"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs($pagename)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Groups')); |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$crstype); |
$crstype); |
Line 147 sub display_groups {
|
Line 162 sub display_groups {
|
my %grp_info = (); |
my %grp_info = (); |
my %actionlinks = ( |
my %actionlinks = ( |
modify => '<a href="/adm/coursegroups?action=modify&refpage='. |
modify => '<a href="/adm/coursegroups?action=modify&refpage='. |
$env{'form.refpage'}.'&groupname=', |
$env{'form.refpage'}.'&state=pick_task&groupname=', |
view => '<a href="/adm/'.$cdom.'/'.$cnum.'/', |
view => '<a href="/adm/'.$cdom.'/'.$cnum.'/', |
delete => '<a href="/adm/coursegroups?action=delete&refpage='. |
delete => '<a href="/adm/coursegroups?action=delete&refpage='. |
$env{'form.refpage'}.'&groupname=', |
$env{'form.refpage'}.'&groupname=', |
Line 157 sub display_groups {
|
Line 172 sub display_groups {
|
view => 'View', |
view => 'View', |
delete => 'Delete', |
delete => 'Delete', |
act => 'Action', |
act => 'Action', |
gname => "$ucgpterm Name", |
gname => 'Group Name', |
desc => 'Description', |
desc => 'Group Title', |
crea => 'Creator', |
crea => 'Creator', |
crtd => 'Created', |
crtd => 'Created', |
last => 'Last Modified', |
last => 'Last Modified', |
func => 'Functionality', |
func => 'Collaborative Tools', |
quot => 'Quota (Mb)', |
quot => 'Quota (Mb)', |
memb => 'Members', |
memb => 'Members', |
file => 'Files', |
file => 'Files', |
dibd => 'Discussion Boards', |
dibd => 'Discussion Boards', |
dius => 'Disk Use (%)', |
dius => 'Disk Use (%)', |
nogr => 'No '.$gpterm.'s exist.', |
nogr => 'No groups exist.', |
crng => 'Create a new '.$gpterm, |
crng => 'Create a new group', |
alth => 'Although your current role has privileges'. |
alth => 'Although your current role has privileges'. |
' to view any existing '.$gpterm.'s in this'. |
' to view any existing groups in this '. |
lc($crstype).', you do not have privileges'. |
lc($crstype).', you do not have privileges '. |
'to create new '.$gpterm.'s.', |
'to create new groups.', |
); |
); |
if ($view_permission) { |
if ($view_permission) { |
if (!defined($action)) { |
if (!defined($action)) { |
Line 182 sub display_groups {
|
Line 197 sub display_groups {
|
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
if (%curr_groups) { |
if (%curr_groups) { |
if ($manage_permission) { |
if ($manage_permission) { |
$r->print('<br /><a href="/adm/coursegroups?action=create&refpage='.$env{'form.refpage'}.'">'.$lt{'crng'}.'</a>'); |
if (!exists($env{'form.refpage'})) { |
|
$r->print('<br /><a href="/adm/coursegroups?action=create">'.$lt{'crng'}.'</a>'); |
|
} |
} |
} |
$r->print('<br /><br />'); |
$r->print('<br /><br />'); |
$r->print(&Apache::loncommon::start_data_table(). |
$r->print(&Apache::loncommon::start_data_table(). |
Line 278 END
|
Line 295 END
|
if ($action eq 'modify' || $action eq 'delete') { |
if ($action eq 'modify' || $action eq 'delete') { |
$link .= $group; |
$link .= $group; |
} else { |
} else { |
$link .= $group.'/grppg'; |
$link .= $group.'/smppg?ref=grouplist'; |
|
if (exists($env{'form.refpage'})) { |
|
$link .= '&refpage='.$env{'form.refpage'}; |
|
} |
} |
} |
$link .= '">'.$lt{$action}.'</a>'; |
$link .= '">'.$lt{$action}.'</a>'; |
if ($action eq 'view') { |
if ($action eq 'view') { |
Line 317 END
|
Line 337 END
|
} else { |
} else { |
$r->print($lt{'nogr'}); |
$r->print($lt{'nogr'}); |
if ($manage_permission) { |
if ($manage_permission) { |
$r->print('<br /><br /><a href="/adm/coursegroups?action=create&refpage='.$env{'form.refpage'}.'">'.$lt{'crng'}.'</a>'); |
if (!exists($env{'form.refpage'})) { |
|
$r->print('<br /><br /><a href="/adm/coursegroups?action=create">'.$lt{'crng'}.'</a>'); |
|
} |
} else { |
} else { |
$r->print('<br /><br />'.$lt{'alth'}); |
$r->print('<br /><br />'.$lt{'alth'}); |
|
|
Line 334 END
|
Line 356 END
|
$curr_groups{$group}); |
$curr_groups{$group}); |
my $description = &unescape( |
my $description = &unescape( |
$group_info{description}); |
$group_info{description}); |
my ($uname,$udom) = split(/:/,$group_info{creator}); |
$r->print('<font size="+1"><a href="/adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg?ref=grouplist">'.$group,'</a><font><br /><small>'.$description.'</small><br /><br />'); |
$r->print('<font size="+1"><a href="/adm/'.$udom.'/'.$uname.'/'.$group.'/grppg">'.$group,'</a><font><br /><small>'.$description.'</small><br /><br />'); |
|
} |
} |
} |
} |
} else { |
} else { |
Line 348 END
|
Line 369 END
|
} |
} |
|
|
sub group_administration { |
sub group_administration { |
my ($r,$action,$state,$cdom,$cnum,$tabcol,$functions,$idx, |
my ($r,$action,$state,$cdom,$cnum,$functions,$idx,$view_permission, |
$view_permission,$manage_permission,$rowColor1,$rowColor2,$gpterm, |
$manage_permission,$gpterm,$ucgpterm,$crstype) = @_; |
$ucgpterm,$crstype) = @_; |
|
my %sectioncount = (); |
my %sectioncount = (); |
my @tools = (); |
my @tools = (); |
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 407 sub group_administration {
|
Line 428 sub group_administration {
|
if ($state eq '') { |
if ($state eq '') { |
if (defined($env{'form.groupname'})) { |
if (defined($env{'form.groupname'})) { |
$state = 'pick_task'; |
$state = 'pick_task'; |
} else { |
|
$state = 'pick_group'; |
|
} |
} |
} else { |
} else { |
%stored = &retrieve_settings($cdom,$cnum,$groupname); |
%stored = &retrieve_settings($cdom,$cnum,$groupname); |
Line 502 sub group_administration {
|
Line 521 sub group_administration {
|
(($action eq 'modify') && (($state eq 'change_settings') || |
(($action eq 'modify') && (($state eq 'change_settings') || |
($state eq 'add_members')))) { |
($state eq 'add_members')))) { |
%sectioncount = &Apache::loncommon::get_sections($cdom,$cnum); |
%sectioncount = &Apache::loncommon::get_sections($cdom,$cnum); |
if (%sectioncount) { |
$elements{'create'}{'pick_name'}{'sectionpick'} = 'selectbox'; |
$elements{'create'}{'pick_name'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'change_mapping'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'change_mapping'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'add_members'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'add_members'}{'sectionpick'} = 'selectbox'; |
|
} |
|
} |
} |
|
|
if (($action eq 'create') || |
if (($action eq 'create') || |
Line 520 sub group_administration {
|
Line 537 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) { |
if (grep/^all$/,@sections) { |
@sections = sort {$a cmp $b} keys(%sectioncount); |
@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,\@sections,\%users, |
&build_members_list($cdom,$cnum,\@types,\@roles,\@buildsections,\%users, |
\%userdata); |
\%userdata); |
} |
} |
if ($state eq 'pick_members') { |
if ($state eq 'pick_members') { |
Line 562 sub group_administration {
|
Line 581 sub group_administration {
|
$num_reenable ++; |
$num_reenable ++; |
next; |
next; |
} elsif (($start > $now)) { |
} elsif (($start > $now)) { |
$num_activate = 1; |
$num_activate ++; |
next; |
next; |
} else { |
} else { |
$num_expire ++; |
$num_expire ++; |
Line 731 sub group_administration {
|
Line 750 sub group_administration {
|
my $space_trim = '/^\s*|\s*\$/g,""'; |
my $space_trim = '/^\s*|\s*\$/g,""'; |
my $float_check = '/^([0-9]*\.?[0-9]*)$/'; |
my $float_check = '/^([0-9]*\.?[0-9]*)$/'; |
$validate_script = ' |
$validate_script = ' |
var newquota = document.'.$state.'.quota.value; |
var newquota = new String(document.'.$state.'.quota.value); |
newquota.replace('.$space_trim.'); |
newquota.replace('.$space_trim.'); |
if (newquota == "" ) { |
if (newquota == "" ) { |
document.'.$state.'.quota.value = 0; |
document.'.$state.'.quota.value = 0; |
newquota = 0; |
newquota = "0"; |
} |
} |
var maxposs = '.$maxposs.'; |
var maxposs = '.sprintf("%.2f",$maxposs).'; |
if (newquota > maxposs) { |
if (newquota > maxposs) { |
alert("The file repository quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); |
alert("The file repository quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); |
return; |
return; |
Line 788 function changeSort(caller) {
|
Line 807 function changeSort(caller) {
|
my %states = (); |
my %states = (); |
my %branchstates = (); |
my %branchstates = (); |
@{$states{'create'}} = ('pick_name','pick_members','pick_privs','result'); |
@{$states{'create'}} = ('pick_name','pick_members','pick_privs','result'); |
@{$states{'modify'}} = ('pick_group','pick_task'); |
@{$states{'modify'}} = ('pick_task'); |
@{$branchstates{'noprivs'}} = ('result'); |
@{$branchstates{'noprivs'}} = ('result'); |
@{$branchstates{'settings'}} = ('change_settings','chgresult'); |
@{$branchstates{'settings'}} = ('change_settings','chgresult'); |
@{$branchstates{'members'}} = ('change_members','change_privs','memresult'); |
@{$branchstates{'members'}} = ('change_members','change_privs','memresult'); |
Line 812 function changeSort(caller) {
|
Line 831 function changeSort(caller) {
|
} |
} |
|
|
my $loaditems = &onload_action($action,$state); |
my $loaditems = &onload_action($action,$state); |
my $crumbtitle = "$crstype $ucgpterm".'s'; |
$r->print(&header("Groups Manager", |
$r->print(&header("$crumbtitle Manager", |
|
$jscript,$action,$state,$page,$loaditems)); |
$jscript,$action,$state,$page,$loaditems)); |
|
|
if ($env{'form.refpage'} eq 'enrl') { |
if ($env{'form.refpage'} eq 'enrl') { |
Line 821 function changeSort(caller) {
|
Line 839 function changeSort(caller) {
|
({href=>"/adm/dropadd", |
({href=>"/adm/dropadd", |
text=>"Enrollment Manager", |
text=>"Enrollment Manager", |
faq=>9,bug=>'Instructor Interface',}); |
faq=>9,bug=>'Instructor Interface',}); |
} else { |
if ($action eq 'modify') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/coursegroups?refpage=enrl&action=modify", |
|
text=>"Groups", |
|
faq=>9,bug=>'Instructor Interface',}); |
|
} |
|
} else { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/coursegroups", |
({href=>"/adm/coursegroups", |
text=>"$crumbtitle", |
text=>"Groups", |
faq=>9,bug=>'Instructor Interface',}); |
faq=>9,bug=>'Instructor Interface',}); |
|
if ($env{'form.refpage'} eq 'grouplist') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/$cdom/$cnum/$env{'form.groupname'}/smppg?ref=grouplist", |
|
text=>"Group: $description",}); |
|
} |
} |
} |
|
|
my %trail = (); |
my %trail = (); |
Line 836 function changeSort(caller) {
|
Line 865 function changeSort(caller) {
|
result => 'Creation Complete', |
result => 'Creation Complete', |
); |
); |
%{$trail{'modify'}} = &Apache::lonlocal::texthash( |
%{$trail{'modify'}} = &Apache::lonlocal::texthash( |
pick_group => $ucgpterm.'s', |
|
pick_task => 'Choose Task', |
pick_task => 'Choose Task', |
change_settings => "$ucgpterm Settings", |
change_settings => "$ucgpterm Settings", |
change_members => 'Modify/Delete Members', |
change_members => 'Modify/Delete Members', |
Line 864 function changeSort(caller) {
|
Line 892 function changeSort(caller) {
|
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{text=>"$trail{$action}{$state}"}); |
{text=>"$trail{$action}{$state}"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
("$crumbtitle Manager")); |
("Groups Manager","Creating_Groups")); |
&display_control($r,$cdom,$cnum,$tabcol,$action,$state,$page, |
&display_control($r,$cdom,$cnum,$action,$state,$page, |
\%sectioncount,$groupname,$description,$functions, |
\%sectioncount,$groupname,$description,$functions, |
\@tools,$toolprivs,$fixedprivs,$startdate,$enddate, |
\@tools,$toolprivs,$fixedprivs,$startdate,$enddate, |
\%users,\%userdata,$idx,\%memchg,\%usertools, |
\%users,\%userdata,$idx,\%memchg,\%usertools, |
$view_permission,$manage_permission, |
$view_permission,$manage_permission, |
\%stored,$granularity,$quota,$specificity,\@types,\@roles, |
\%stored,$granularity,$quota,$specificity,\@types,\@roles, |
\@sections,\%states,\%navbuttons,$rowColor1,$rowColor2, |
\@sections,\%states,\%navbuttons,$gpterm,$ucgpterm, |
$gpterm,$ucgpterm,$crstype); |
$crstype); |
last; |
last; |
} else { |
} else { |
if (($state eq 'result') && ($i > 0)) { |
if (($state eq 'result') && ($i > 0)) { |
Line 889 function changeSort(caller) {
|
Line 917 function changeSort(caller) {
|
} elsif (($action eq 'view') && ($view_permission)) { |
} elsif (($action eq 'view') && ($view_permission)) { |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{text=>"View $gpterm".'s'}); |
{text=>"View $gpterm".'s'}); |
my $crumbtitle = "$crstype $ucgpterm".'s Manager'; |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
(&mt($crumbtitle))); |
('Groups Manager')); |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$crstype); |
$crstype); |
Line 948 sub retrieve_settings {
|
Line 975 sub retrieve_settings {
|
foreach my $role (sort(keys(%{$groupinfo{'autosec'}}))) { |
foreach my $role (sort(keys(%{$groupinfo{'autosec'}}))) { |
if (ref($groupinfo{'autosec'}{$role}) eq 'ARRAY') { |
if (ref($groupinfo{'autosec'}{$role}) eq 'ARRAY') { |
foreach my $section (@{$groupinfo{'autosec'}{$role}}) { |
foreach my $section (@{$groupinfo{'autosec'}{$role}}) { |
|
|
push (@{$stored{'sec_'.$role}},$section); |
push (@{$stored{'sec_'.$role}},$section); |
} |
} |
if (@{$groupinfo{'autosec'}{$role}} > 0) { |
if (@{$groupinfo{'autosec'}{$role}} > 0) { |
Line 960 sub retrieve_settings {
|
Line 988 sub retrieve_settings {
|
} |
} |
|
|
sub display_control { |
sub display_control { |
my ($r,$cdom,$cnum,$tabcol,$action,$state,$page,$sectioncount,$groupname, |
my ($r,$cdom,$cnum,$action,$state,$page,$sectioncount,$groupname, |
$description,$functions,$tools,$toolprivs,$fixedprivs,$startdate, |
$description,$functions,$tools,$toolprivs,$fixedprivs,$startdate, |
$enddate,$users,$userdata,$idx,$memchg,$usertools, |
$enddate,$users,$userdata,$idx,$memchg,$usertools, |
$view_permission,$manage_permission,$stored,$granularity,$quota, |
$view_permission,$manage_permission,$stored,$granularity,$quota, |
$specificity,$types,$roles,$sections,$states,$navbuttons,$rowColor1, |
$specificity,$types,$roles,$sections,$states,$navbuttons, |
$rowColor2,$gpterm,$ucgpterm,$crstype) = @_; |
$gpterm,$ucgpterm,$crstype) = @_; |
if ($action eq 'create') { |
if ($action eq 'create') { |
if ($state eq 'pick_name') { |
if ($state eq 'pick_name') { |
&general_settings_form($r,$cdom,$cnum,$action,$state,$page, |
&general_settings_form($r,$cdom,$cnum,$action,$state,$page, |
Line 995 sub display_control {
|
Line 1023 sub display_control {
|
} |
} |
} elsif ($action eq 'modify') { |
} elsif ($action eq 'modify') { |
my $groupname = $env{'form.groupname'}; |
my $groupname = $env{'form.groupname'}; |
if ($state eq 'pick_group') { |
if ($state eq 'pick_task') { |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
|
$manage_permission,$action,$state,$gpterm, |
|
$ucgpterm,$crstype); |
|
} elsif ($state eq 'pick_task') { |
|
&modify_menu($r,$groupname,$page,$gpterm); |
&modify_menu($r,$groupname,$page,$gpterm); |
} elsif ($state eq 'change_settings') { |
} elsif ($state eq 'change_settings') { |
&general_settings_form($r,$cdom,$cnum,$action,$state,$page, |
&general_settings_form($r,$cdom,$cnum,$action,$state,$page, |
Line 1007 sub display_control {
|
Line 1031 sub display_control {
|
$sectioncount,$stored,$states,$navbuttons, |
$sectioncount,$stored,$states,$navbuttons, |
$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype); |
} elsif ($state eq 'change_members') { |
} elsif ($state eq 'change_members') { |
&change_members_form($r,$cdom,$cnum,$tabcol,$action,$state,$page, |
&change_members_form($r,$cdom,$cnum,$action,$state,$page, |
$groupname,$description,$startdate,$enddate, |
$groupname,$description,$startdate,$enddate, |
$tools,$fixedprivs,$functions,$users, |
$tools,$fixedprivs,$functions,$users, |
$userdata,$granularity,$quota,$specificity, |
$userdata,$granularity,$quota,$specificity, |
$idx,$states,$navbuttons,$rowColor1,$rowColor2, |
$idx,$states,$navbuttons,$gpterm,$ucgpterm); |
$gpterm,$ucgpterm); |
|
} elsif ($state eq 'add_members') { |
} elsif ($state eq 'add_members') { |
&add_members_form($r,$action,$state,$page,$startdate, |
&add_members_form($r,$cdom,$cnum,$action,$state,$page,$startdate, |
$enddate,$groupname,$description,$granularity, |
$enddate,$groupname,$description,$granularity, |
$quota,$sectioncount,$tools,$functions,$stored, |
$quota,$sectioncount,$tools,$functions,$stored, |
$states,$navbuttons,$gpterm,$ucgpterm); |
$states,$navbuttons,$gpterm,$ucgpterm); |
Line 1085 sub onload_action {
|
Line 1108 sub onload_action {
|
} |
} |
if (($action eq 'modify') && |
if (($action eq 'modify') && |
($state eq 'change_settings' || $state eq 'change_members' || |
($state eq 'change_settings' || $state eq 'change_members' || |
$state eq 'change_privs' || $state eq 'add_members' || |
$state eq 'change_privs' || $state eq 'add_members')) { |
$state eq 'pick_members')) { |
|
$loaditems{'onload'} = |
$loaditems{'onload'} = |
'javascript:setFormElements(document.'.$state.')'; |
'javascript:setFormElements(document.'.$state.')'; |
} |
} |
Line 1139 sub group_members {
|
Line 1161 sub group_members {
|
my ($cdom,$cnum,$group,$group_info) = @_; |
my ($cdom,$cnum,$group,$group_info) = @_; |
my %memberhash = &Apache::lonnet::get_group_membership($cdom,$cnum,$group); |
my %memberhash = &Apache::lonnet::get_group_membership($cdom,$cnum,$group); |
my $now = time; |
my $now = time; |
my ($tmp)=keys(%memberhash); |
my %lt = &Apache::lonlocal::texthash ( |
if ($tmp=~/^error:/) { |
active => 'active', |
$$group_info{'totalmembers'} = 'Unknown - an error occurred'; |
previous => 'previous', |
return $tmp; |
future => 'future', |
} |
); |
|
my %membercounts = ( |
|
active => 0, |
|
previous => 0, |
|
future => 0, |
|
); |
my $totalmembers = 0; |
my $totalmembers = 0; |
my $active = 0; |
|
my $previous = 0; |
|
my $future = 0; |
|
foreach my $member (keys %memberhash) { |
foreach my $member (keys %memberhash) { |
$totalmembers ++; |
$totalmembers ++; |
my ($end,$start) = split(/:/,$memberhash{$member}); |
my ($end,$start) = split(/:/,$memberhash{$member}); |
unless ($start == -1) { |
unless ($start == -1) { |
if (($end!=0) && ($end<$now)) { |
if (($end!=0) && ($end<$now)) { |
$previous ++; |
$membercounts{previous} ++; |
} elsif (($start!=0) && ($start>$now)) { |
} elsif (($start!=0) && ($start>$now)) { |
$future ++; |
$membercounts{future} ++; |
} else { |
} else { |
$active ++; |
$membercounts{active} ++; |
} |
} |
} |
} |
} |
} |
if ($totalmembers == 0) { |
if ($totalmembers == 0) { |
$$group_info{$group}{'totalmembers'} = 'None'; |
$$group_info{$group}{'totalmembers'} = 'None'; |
} else { |
} else { |
$$group_info{$group}{'totalmembers'} = '<nobr>'.$active. |
foreach my $type ('active','previous','future') { |
' - active</nobr><br /><nobr>'.$previous. |
$$group_info{$group}{'totalmembers'} .= |
' - previous</nobr><br /><nobr>'.$future. |
&open_list_window($group,$type,$membercounts{$type},$lt{$type}); |
' - future</nobr>'; |
} |
} |
} |
return 'ok'; |
return 'ok'; |
} |
} |
|
|
|
sub open_list_window { |
|
my ($group,$status,$count,$text) = @_; |
|
my $entry; |
|
if ($count > 0) { |
|
$entry = '<nobr><a href="javascript:openGroupRoster('. |
|
"'$group','$status'".')">'.$text.'</a> - '.$count. |
|
'</nobr><br />'; |
|
} else { |
|
$entry = '<nobr>'.$text.' - '.$count.'</nobr><br />'; |
|
} |
|
return $entry; |
|
} |
|
|
|
|
sub general_settings_form { |
sub general_settings_form { |
my ($r,$cdom,$cnum,$action,$formname,$page,$functions,$tools, |
my ($r,$cdom,$cnum,$action,$formname,$page,$functions,$tools, |
Line 1182 sub general_settings_form {
|
Line 1219 sub general_settings_form {
|
$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype); |
&access_date_settings($r,$action,$formname,$stored,2,$gpterm,$ucgpterm); |
&access_date_settings($r,$action,$formname,$stored,2,$gpterm,$ucgpterm); |
if ($action eq 'create') { |
if ($action eq 'create') { |
&membership_options($r,$action,$formname,$sectioncount,3,$gpterm, |
&membership_options($r,$cdom,$cnum,$action,$formname,$sectioncount,3, |
$ucgpterm); |
$gpterm,$ucgpterm); |
$nexttext = $$navbuttons{'gtns'}; |
$nexttext = $$navbuttons{'gtns'}; |
} else { |
} else { |
my @available = (); |
my @available = (); |
Line 1195 sub general_settings_form {
|
Line 1232 sub general_settings_form {
|
$gpterm,$ucgpterm); |
$gpterm,$ucgpterm); |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
$states,$stored,$navbuttons,4,5, |
$states,$stored,$navbuttons,4,5, |
$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype,$cdom,$cnum); |
$nexttext = $$navbuttons{'mose'}; |
$nexttext = $$navbuttons{'mose'}; |
} |
} |
$prevtext = $$navbuttons{'gtpp'}; |
$prevtext = $$navbuttons{'gtpp'}; |
Line 1208 sub groupsettings_options {
|
Line 1245 sub groupsettings_options {
|
my ($r,$functions,$action,$formname,$stored,$image,$gpterm, |
my ($r,$functions,$action,$formname,$stored,$image,$gpterm, |
$ucgpterm,$crstype) = @_; |
$ucgpterm,$crstype) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'gdat' => "$ucgpterm open and close dates", |
'gdat' => "Group access start and end dates", |
'sten' => "Set a start date/time and end date/time for the $gpterm", |
'gnde' => "Group name, title and available collaborative tools", |
'gfun' => "$ucgpterm functionality", |
'desc' => 'Group Title', |
'gnde' => "$ucgpterm name, description and available functionality", |
'func' => 'Collaborative Tools', |
'desc' => 'Description', |
'gnam' => 'Group Name', |
'func' => 'Functionality', |
'lett' => 'Letters, numbers and underscore only', |
'gnam' => "$ucgpterm Name", |
'doyo' => 'Different subsets of the chosen collaborative tools '. |
'doyo' => "Do you want to assign different functionality ". |
'for different group members?', |
"to different $gpterm 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'}); |
&topic_bar($r,$image,$lt{'gnde'}); |
Line 1227 sub groupsettings_options {
|
Line 1263 sub groupsettings_options {
|
<td colspan="5"> |
<td colspan="5"> |
'); |
'); |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print('<input type="text" name="groupname" size="25" />'); |
$r->print('<input type="text" name="groupname" size="25" /> ('. |
|
$lt{'lett'}.')'); |
} else { |
} else { |
$r->print('<input type="hidden" name="groupname" value="'. |
$r->print('<input type="hidden" name="groupname" value="'. |
$env{'form.groupname'}.'" />'.$env{'form.groupname'}); |
$env{'form.groupname'}.'" />'.$env{'form.groupname'}); |
Line 1295 END
|
Line 1332 END
|
$r->print(' <input type="text" name="quota" size="4" />Mb'); |
$r->print(' <input type="text" name="quota" size="4" />Mb'); |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print('<br />'. |
$r->print('<br />'. |
&mt('A total of [_1] Mb is shared between all [_2]s in the '. |
&mt('A total of [_1] Mb can be divided amongst all [_2]s in the '. |
'[_3], and [_4] Mb are currently unallocated.',$crsquota, |
'[_3], and [_4] Mb are currently unallocated.',$crsquota, |
$gpterm,lc($crstype),$freespace)); |
$gpterm,lc($crstype),sprintf("%.2f",$freespace))); |
} else { |
} else { |
$r->print(' ('.&mt('The quota is currently [_1] Mb', |
$r->print(' ('.&mt('The quota is currently [_1] Mb', |
$$stored{'quota'}).').'); |
$$stored{'quota'}).').'); |
|
|
$r->print('<br />'.&mt('The quota can be increased to [_1] Mb, '. |
$r->print('<br />'.&mt('The quota can be increased to [_1] Mb, '. |
'by adding all unallocated space for [_2]s in the [_3].', |
'by adding all unallocated space for [_2]s in the [_3].', |
$maxposs,$gpterm,lc($crstype))); |
sprintf("%.2f",$maxposs),$gpterm,lc($crstype))); |
} |
} |
$r->print(' |
$r->print(' |
</td> |
</td> |
Line 1331 sub get_quota_constraints {
|
Line 1368 sub get_quota_constraints {
|
} |
} |
|
|
sub membership_options { |
sub membership_options { |
my ($r,$action,$state,$sectioncount,$image,$gpterm,$ucgpterm) = @_; |
my ($r,$cdom,$cnum,$action,$state,$sectioncount,$image,$gpterm,$ucgpterm)=@_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'pipa' => 'Pick parameters to generate membership list', |
'pipa' => 'Build a list of users for selection of group members', |
'gmem' => "$ucgpterm membership options", |
'gmem' => "Group membership selection list criteria:", |
'picr' => 'Pick the criteria to use to build a list of '. |
'picr' => 'Pick the criteria to use to build a list of '. |
lc($crstype).' users from which you will select ', |
lc($crstype).' users from which you will select ', |
'meof' => "members of the new $gpterm.", |
'meof' => "members of the new group.", |
'admg' => "additional members of the $gpterm.", |
'admg' => "additional members of the group.", |
'ifno' => "If you do not wish to add members when you first ". |
'ifno' => "If you do not wish to add members when you first ". |
"create the $gpterm, do not make any selections.", |
"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 $gpterm members triggered by specified role and section changes.", |
'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' => $crstype.' roles', |
'coro' => $crstype.' roles', |
'cose' => $crstype.' sections', |
'cose' => $crstype.' sections', |
Line 1353 sub membership_options {
|
Line 1390 sub membership_options {
|
future => &mt('Will have future access'), |
future => &mt('Will have future access'), |
); |
); |
|
|
#FIXME need to plumb around for the various cr roles defined by the user |
my @roles = ('st','cc','in','ta','ep','cr'); |
my @roles = ('st','cc','in','ta','ep'); |
|
|
|
my @sections = keys(%{$sectioncount}); |
my @sections = keys(%{$sectioncount}); |
|
|
Line 1372 sub membership_options {
|
Line 1408 sub membership_options {
|
<table class="LC_status_selector"> |
<table class="LC_status_selector"> |
<tr> |
<tr> |
<th>'.$lt{'acty'}.'</th> |
<th>'.$lt{'acty'}.'</th> |
<th>'.$lt{'coro'}.'</th>'); |
<th>'.$lt{'coro'}.'</th> |
if (@sections >0) { |
<th>'.$lt{'cose'}.'</th> |
$r->print(' |
</tr><tr><td>'); |
<th>'.$lt{'cose'}.'</th>'); |
|
} |
|
$r->print('</tr><tr><td>'); |
|
$r->print(&Apache::lonhtmlcommon::status_select_row(\%status_types)); |
$r->print(&Apache::lonhtmlcommon::status_select_row(\%status_types)); |
$r->print('</td><td>'); |
$r->print('</td><td>'); |
$r->print(&Apache::lonhtmlcommon::role_select_row(\@roles)); |
$r->print(&Apache::lonhtmlcommon::role_select_row(\@roles,undef,undef,1,$cdom,$cnum)); |
if (@sections > 0) { |
if (@sections > 0) { |
@sections = sort {$a cmp $b} @sections; |
@sections = sort {$a cmp $b} @sections; |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
$r->print('</td><td>'. |
} else { |
§ions_selection(\@sections,'sectionpick').'</td>'); |
@sections = ('all','none'); |
} |
} |
$r->print(' |
$r->print('</td><td>'. |
|
§ions_selection(\@sections,'sectionpick').'</td> |
</tr> |
</tr> |
</table>'); |
</table>'); |
return; |
return; |
Line 1403 sub sections_selection {
|
Line 1437 sub sections_selection {
|
} |
} |
foreach my $sec (@{$sections}) { |
foreach my $sec (@{$sections}) { |
if ($sec eq 'all') { |
if ($sec eq 'all') { |
$section_sel .= ' <option value="'.$sec.'" selected="selected">'.&mt('all sections').'</option>'."\n"; |
$section_sel .= ' <option value="'.$sec.'">'.&mt('all sections').'</option>'."\n"; |
} elsif ($sec eq 'none') { |
} elsif ($sec eq 'none') { |
$section_sel .= ' <option value="'.$sec.'">'.&mt('no section').'</option>'."\n"; |
$section_sel .= ' <option value="'.$sec.'">'.&mt('no section').'</option>'."\n"; |
} else { |
} else { |
Line 1535 sub print_current_settings {
|
Line 1569 sub print_current_settings {
|
$granularity,$quota,$available,$unavailable,$gpterm,$ucgpterm) = @_; |
$granularity,$quota,$available,$unavailable,$gpterm,$ucgpterm) = @_; |
|
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
grna => "$ucgpterm Name", |
grna => 'Group Name', |
desc => 'Description', |
desc => 'Group Title', |
grfn => "$ucgpterm Functions", |
grfn => "Collaborative Tools", |
gran => 'Granularity', |
gran => 'Granularity', |
quot => 'File quota', |
quot => 'File quota', |
dfac => 'Default access dates', |
dfac => 'Default access dates', |
ygrs => "Your $gpterm selections", |
ygrs => "Your group selections - ", |
tfwa => "The following settings will apply to the $gpterm:", |
tfwa => "The following settings will apply to the group:", |
difn => 'Different functionality<br />for different members:', |
difn => 'Different collaborative tools<br />for different members:', |
stda => 'Start date', |
stda => 'Start date', |
enda => 'End date:', |
enda => 'End date:', |
); |
); |
Line 1578 sub print_current_settings {
|
Line 1612 sub print_current_settings {
|
<td> |
<td> |
'); |
'); |
if (@{$available} > 0) { |
if (@{$available} > 0) { |
$r->print('<b>Available:</b> |
$r->print(&mt('<b>Available for assignment to members:</b>'). |
<table cellpadding="" cellspacing="1"><tr>'); |
'<table class="LC_group_priv"><tr>'); |
my $rowcell = int(@{$available}/2) + @{$available}%2; |
my $rowcell = int(@{$available}/2) + @{$available}%2; |
for (my $i=0; $i<@{$available}; $i++) { |
for (my $i=0; $i<@{$available}; $i++) { |
if (@{$available} > 3) { |
if (@{$available} > 3) { |
Line 1596 sub print_current_settings {
|
Line 1630 sub print_current_settings {
|
$r->print('</tr></table><br />'); |
$r->print('</tr></table><br />'); |
} |
} |
if (@{$unavailable} > 0) { |
if (@{$unavailable} > 0) { |
$r->print('<b>Unavailable:</b> |
$r->print(&mt('<b>Unavailable for assignment:</b>'). |
<table cellpadding="0" cellspacing="1" border="0"><tr>'); |
'<table class="LC_group_priv"><tr>'); |
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; |
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; |
for (my $j=0; $j<@{$unavailable}; $j++) { |
for (my $j=0; $j<@{$unavailable}; $j++) { |
if (@{$unavailable} > 3) { |
if (@{$unavailable} > 3) { |
Line 1630 sub pick_new_members {
|
Line 1664 sub pick_new_members {
|
my ($r,$action,$formname,$available,$idx,$stored,$img,$users,$userdata, |
my ($r,$action,$formname,$available,$idx,$stored,$img,$users,$userdata, |
$granularity,$origmembers,$gpterm,$ucgpterm) = @_; |
$granularity,$origmembers,$gpterm,$ucgpterm) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'gpme' => "$ucgpterm membership", |
'gpme' => "Group membership", |
'addm' => 'Add members', |
'addm' => 'Add members', |
'setf' => 'Set functionality', |
'setf' => 'Assign collaborative tools', |
'func' => 'Functionality', |
'func' => 'Tools', |
'nome' => 'No members to add at this time.', |
'nome' => 'No members to add at this time, as there are no users '. |
|
'matching the specified type(s), role(s) and section(s).', |
'nnew' => "There are no users to add as new members, as all users". |
'nnew' => "There are no users to add as new members, as all users". |
" matching the specified type(s), role(s), and/or ". |
" matching the specified type(s), role(s), and ". |
"section(s) are already affiliated with this $gpterm.", |
"section(s) are already affiliated with this group.", |
'yoma' => 'You may need to use the '."'".'modify existing, past or '. |
'yoma' => 'You may need to use the '."'".'modify existing, past or '. |
'future members'."'".' page if you need to re-enable '. |
'future members'."'".' page if you need to re-enable '. |
'or activate access for previous or future members.', |
'or activate access for previous or future members.', |
Line 1671 sub pick_new_members {
|
Line 1706 sub pick_new_members {
|
<tr>'); |
<tr>'); |
&check_uncheck_buttons($r,$formname,'member',$lt{'addm'}); |
&check_uncheck_buttons($r,$formname,'member',$lt{'addm'}); |
if (@{$available} > 0 && $granularity eq 'Yes') { |
if (@{$available} > 0 && $granularity eq 'Yes') { |
$r->print('<td><nobr> |
$r->print('<td> |
<fieldset><legend><b>'.$lt{'setf'}.'</b></legend> |
<fieldset><legend><b>'.$lt{'setf'}.'</b></legend> |
|
<nobr> |
<input type="button" value="check all" |
<input type="button" value="check all" |
onclick="javascript:checkAllTools(document.'.$formname.')" /> |
onclick="javascript:checkAllTools(document.'.$formname.')" /> |
|
|
<input type="button" value="uncheck all" |
<input type="button" value="uncheck all" |
onclick="javascript:uncheckAllTools(document.'.$formname.')" /> |
onclick="javascript:uncheckAllTools(document.'.$formname.')" /> |
</fieldset></nobr></td>'); |
</nobr> |
|
</fieldset></td>'); |
} |
} |
$r->print('</tr></table> |
$r->print('</tr></table> |
'); |
'); |
Line 1771 sub privilege_specificity {
|
Line 1808 sub privilege_specificity {
|
my ($r,$action,$img,$tools,$stored,$toolprivs,$fixedprivs,$available, |
my ($r,$action,$img,$tools,$stored,$toolprivs,$fixedprivs,$available, |
$formname,$gpterm,$ucgpterm) = @_; |
$formname,$gpterm,$ucgpterm) = @_; |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'uprv' => 'User privileges', |
'uprv' => 'User privileges for collaborative tools', |
'frty' => 'For each type of functionality you have chosen to include, '. |
'frty' => 'For each collaborative tool you have chosen to include, '. |
'there is a set of standard privileges which apply to all '. |
'there is a set of core privileges which all group members '. |
'of those for whom the functionality is enabled.', |
'assigned use of the tool will receive.', |
'thar' => 'There are also additional privileges which can be set for '. |
'thar' => 'For some tools there are also additional optional '. |
'some, or all, members. Please choose one of the following:', |
'privileges which can be set.', |
'fort' => 'For the types of functionality you have chosen to include '. |
'plch' => 'Choose one of the following:', |
'there are no additional privileges which can be set for some '. |
'fort' => 'For the collaborative tools you have chosen to include '. |
'or all members.', |
'only core privileges are available, '. |
'eaty' => 'Each of the types of functionality includes standard '. |
'so there are no optional privileges to assign.', |
'privileges which apply to members with access to that '. |
'eaty' => 'Each collaborative tool includes core '. |
'functionality, and may also include additional privileges '. |
'privileges assigned to all members with access to the '. |
|
'tool. Some tools may also feature additional privileges '. |
'which can be set for specific members.', |
'which can be set for specific members.', |
'cutg' => "Currently the $gpterm is configured ", |
'cutg' => 'Currently the group is configured ', |
'sdif' => "so different $gpterm members can receive different privileges.", |
'sdif' => 'so different members can receive different optional privileges for a particular tool.', |
'sall' => "so all $gpterm members will receive the same privileges.", |
'sall' => 'so all members will receive the same optional privileges for a particular tool.', |
'algm' => "All $gpterm members will receive the same privileges.", |
'algm' => 'All group members will receive the same privileges for any tool assigned to them, including the default set of optional privileges.', |
'smgp' => "Some $gpterm members will receive different privileges from ". |
'smgp' => 'Different group members may receive different privileges from '. |
"others.", |
'others for the tools they have been assigned.', |
'thwi' => "These will be the privileges all $gpterm members receive, ". |
'thwi' => 'These will be the privileges all group members receive for a particular assigned tool, '. |
"if you selected the first option above.", |
'if you selected the first option above.', |
'thes' => "These will be the privileges given to members assigned ". |
'thes' => "These will be the privileges given to members assigned ". |
"in the future, including via automatic $gpterm assignment ". |
"in the future via automatic group assignment ". |
"for specific sections/roles ", |
"for users who receive specific sections/roles in the course ", |
'asyo' => "As you have chosen not to include any functionality in the ". |
'asyo' => "As you have chosen not to include any collaborative tools ". |
"$gpterm, no default user privileges settings need to be set.", |
"in the group, no default optional privileges need to be set.", |
'plin' => 'Please indicate which <b>optional</b> privileges members '. |
'plin' => 'Indicate which <b>optional</b> privileges members '. |
'will receive by default.', |
'will receive by default for a specific tool.', |
'oppr' => 'Optional privileges', |
'oppr' => 'Optional privileges', |
'defp' => 'The default privileges new members will receive are:', |
'defp' => 'The default privileges new members will receive are:', |
); |
); |
Line 1812 sub privilege_specificity {
|
Line 1850 sub privilege_specificity {
|
} |
} |
&topic_bar($r,$img,$lt{'uprv'}); |
&topic_bar($r,$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 = ( |
'No' => 'checked="checked"', |
'No' => 'checked="checked"', |
'Yes' => '', |
'Yes' => '', |
Line 1820 sub privilege_specificity {
|
Line 1858 sub privilege_specificity {
|
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print($lt{'frty'}.'<br />'); |
$r->print($lt{'frty'}.'<br />'); |
if ($totaloptionalprivs) { |
if ($totaloptionalprivs) { |
$r->print($lt{'thar'}); |
$r->print($lt{'thar'}.'<br /><br />'.$lt{'plch'}); |
} else { |
} else { |
$r->print($lt{'fort'}); |
$r->print($lt{'fort'}); |
} |
} |
Line 1836 sub privilege_specificity {
|
Line 1874 sub privilege_specificity {
|
} |
} |
if ($totaloptionalprivs) { |
if ($totaloptionalprivs) { |
$r->print(' |
$r->print(' |
<br /><br /> |
<br /> |
<label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' /> '.$lt{'algm'}.'</nobr></label><br /> |
<label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' /> '.$lt{'algm'}.'</nobr></label><br /> |
<label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' /> '.$lt{'smgp'}.'</nobr></label>'); |
<label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' /> '.$lt{'smgp'}.'</nobr></label><br /><br />'); |
} else { |
} else { |
$r->print('<input type="hidden" name="specificity" value="No" />'); |
$r->print('<input type="hidden" name="specificity" value="No" />'); |
} |
} |
if ($totaloptionalprivs) { |
if ($totaloptionalprivs) { |
$r->print($lt{'plin'}); |
$r->print($lt{'plin'}); |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print(' '.$lt{'thwi'}); |
$r->print('<br />'.$lt{'thwi'}); |
} |
} |
$r->print('<br />'.$lt{'thes'}); |
$r->print('<br />'.$lt{'thes'}); |
if ($action eq 'create') { |
if ($action eq 'create') { |
Line 1869 sub privilege_specificity {
|
Line 1907 sub privilege_specificity {
|
} else { |
} else { |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print($lt{'asyo'}); |
$r->print($lt{'asyo'}); |
|
$r->print('<input type="hidden" name="specificity" value="No" />'); |
} elsif ($action eq 'modify' && $formname eq 'pick_members') { |
} elsif ($action eq 'modify' && $formname eq 'pick_members') { |
my @defprivs; |
my @defprivs; |
if (ref($$stored{'defpriv'}) eq 'ARRAY') { |
if (ref($$stored{'defpriv'}) eq 'ARRAY') { |
Line 1893 sub default_privileges {
|
Line 1932 sub default_privileges {
|
'addp' => 'Additional privileges', |
'addp' => 'Additional privileges', |
'fixp' => 'Fixed privileges', |
'fixp' => 'Fixed privileges', |
'oppr' => 'Optional privileges', |
'oppr' => 'Optional privileges', |
'func' => 'Function', |
'func' => 'Collaborative Tool', |
); |
); |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box'). |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box'). |
&Apache::lonhtmlcommon::row_title($lt{'func'},undef, |
&Apache::lonhtmlcommon::row_title($lt{'func'},undef, |
Line 1913 sub default_privileges {
|
Line 1952 sub default_privileges {
|
if ($fixed ne '') { |
if ($fixed ne '') { |
$fixed .= '</td><td class="LC_groups_fixed">'; |
$fixed .= '</td><td class="LC_groups_fixed">'; |
} |
} |
$fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.' '; |
$fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" /><nobr>'.$$toolprivs{$tool}{$priv}.' '; |
if ($action eq 'modify') { |
if ($action eq 'modify') { |
if (grep(/^$tool$/,@{$available})) { |
if (grep(/^$tool$/,@{$available})) { |
$fixed .= '<small>'.&mt('(on)').'<small> '; |
$fixed .= '<small>'.&mt('(on)').'<small> '; |
Line 1921 sub default_privileges {
|
Line 1960 sub default_privileges {
|
$fixed .= '<small>'.&mt('(off)').'<small> '; |
$fixed .= '<small>'.&mt('(off)').'<small> '; |
} |
} |
} |
} |
|
$fixed .= '</nobr>'; |
} else { |
} else { |
$privcount++; |
$privcount++; |
if ($privcount == 3) { |
if ($privcount == 3) { |
$dynamic .= '</tr> |
$dynamic .= '</tr> |
<tr>'."\n"; |
<tr>'."\n"; |
} |
} |
$dynamic .= '<td><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></td>'."\n"; |
$dynamic .= '<td><nobr><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></nobr></td>'."\n"; |
} |
} |
} |
} |
if ($privcount == 0) { |
if ($privcount == 0) { |
$dynamic .= '<td>None</td>'."\n"; |
$dynamic .= '<td>None</td>'."\n"; |
} |
} |
if ($privcount < 3) { |
if ($privcount < 3) { |
$dynamic .= '</td> |
$dynamic .= '<td> </td>'."\n"; |
<td> </td>'."\n"; |
|
} elsif ($privcount%2) { |
} elsif ($privcount%2) { |
$dynamic = '<td> </td>'."\n"; |
$dynamic = '<td> </td>'."\n"; |
} |
} |
Line 1962 sub display_defprivs {
|
Line 2001 sub display_defprivs {
|
my $rowColor2 = "#eeeeee"; |
my $rowColor2 = "#eeeeee"; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'priv' => 'Privileges', |
'priv' => 'Privileges', |
'func' => 'Function', |
'func' => 'Collaborative Tool', |
); |
); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print('<tr>'); |
$r->print('<tr>'); |
Line 2028 sub display_defprivs {
|
Line 2067 sub display_defprivs {
|
|
|
|
|
sub change_members_form { |
sub change_members_form { |
my ($r,$cdom,$cnum,$tabcol,$action,$formname,$page,$groupname,$description, |
my ($r,$cdom,$cnum,$action,$formname,$page,$groupname,$description, |
$startdate,$enddate,$tools,$fixedprivs,$functions,$users,$userdata, |
$startdate,$enddate,$tools,$fixedprivs,$functions,$users,$userdata, |
$granularity,$quota,$specificity,$idx,$states,$navbuttons,$rowColor1, |
$granularity,$quota,$specificity,$idx,$states,$navbuttons,$gpterm, |
$rowColor2,$gpterm,$ucgpterm) = @_; |
$ucgpterm) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
grse => "$ucgpterm settings", |
grse => "$ucgpterm settings", |
mogm => "Modify $gpterm membership", |
mogm => "Modify $gpterm membership", |
Line 2055 sub change_members_form {
|
Line 2094 sub change_members_form {
|
$groupname,$description,$granularity,$quota, |
$groupname,$description,$granularity,$quota, |
\@available,\@unavailable,$gpterm,$ucgpterm); |
\@available,\@unavailable,$gpterm,$ucgpterm); |
&topic_bar($r,2,$lt{'mogm'}); |
&topic_bar($r,2,$lt{'mogm'}); |
¤t_membership($r,$cdom,$cnum,$formname,$tabcol,$rowColor1, |
my $numcurrent = ¤t_membership($r,$cdom,$cnum,$formname,$groupname, |
$rowColor2,$groupname,\@available,\@unavailable, |
\@available,\@unavailable,$fixedprivs, |
$fixedprivs,$granularity,$specificity); |
$granularity,$specificity); |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
if ($numcurrent > 0) { |
$$states{$action}[$page+1],$nexttext); |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
|
$$states{$action}[$page+1],$nexttext); |
|
} else { |
|
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext); |
|
} |
return; |
return; |
} |
} |
|
|
sub current_membership { |
sub current_membership { |
my ($r,$cdom,$cnum,$formname,$tabcol,$rowColor1,$rowColor2,$groupname, |
my ($r,$cdom,$cnum,$formname,$groupname,$available,$unavailable, |
$available,$unavailable,$fixedprivs,$granularity,$specificity) = @_; |
$fixedprivs,$granularity,$specificity) = @_; |
my %membership = &Apache::lonnet::get_group_membership($cdom,$cnum, |
my %membership = &Apache::lonnet::get_group_membership($cdom,$cnum, |
$groupname); |
$groupname); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
Line 2079 sub current_membership {
|
Line 2122 sub current_membership {
|
'reen' => 'Re-enable', |
'reen' => 'Re-enable', |
'acti' => 'Activate', |
'acti' => 'Activate', |
'dele' => 'Delete', |
'dele' => 'Delete', |
'curf' => 'Current Functionality', |
'curf' => 'Current Tool Set', |
'chpr' => 'Change Privileges' |
'chpr' => 'Change Privileges' |
); |
); |
my ($current,$hastools,$addtools,$num_reenable,$num_activate,$num_expire) = |
my ($current,$num_items,$hastools,$addtools) = |
&Apache::longroup::group_memberlist($cdom,$cnum,$groupname,$fixedprivs, |
&Apache::longroup::group_memberlist($cdom,$cnum,$groupname,$fixedprivs, |
$available); |
$available); |
if (keys(%{$current}) > 0) { |
my $numcurrent = scalar(keys(%{$current})); |
|
if ($numcurrent > 0) { |
$r->print(' |
$r->print(' |
<tr> |
|
<td> </td> |
|
<td colspan="2"> |
|
<table> |
<table> |
<tr>'); |
<tr>'); |
if ($num_expire) { |
if ($num_items->{'active'}) { |
&check_uncheck_buttons($r,$formname,'expire',$lt{'expi'}); |
&check_uncheck_buttons($r,$formname,'expire',$lt{'expi'}); |
} |
} |
if ($num_reenable) { |
if ($num_items->{'previous'}) { |
&check_uncheck_buttons($r,$formname,'reenable',$lt{'reen'}); |
&check_uncheck_buttons($r,$formname,'reenable',$lt{'reen'}); |
} |
} |
if ($num_activate) { |
if ($num_items->{'future'}) { |
&check_uncheck_buttons($r,$formname,'activate',$lt{'acti'}); |
&check_uncheck_buttons($r,$formname,'activate',$lt{'acti'}); |
} |
} |
&check_uncheck_buttons($r,$formname,'deletion',$lt{'dele'}); |
&check_uncheck_buttons($r,$formname,'deletion',$lt{'dele'}); |
Line 2126 sub current_membership {
|
Line 2167 sub current_membership {
|
$r->print(<<"END"); |
$r->print(<<"END"); |
</tr> |
</tr> |
</table> |
</table> |
</td> |
<br /> |
<td width="100%"> </td> |
|
</tr> |
|
<tr> |
|
<td colspan="4"> </td> |
|
</tr> |
|
<tr> |
|
<td> </td> |
|
<td colspan="3"> |
|
END |
END |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<table border="0" cellpadding="4" cellspacing="1"> |
<th>$lt{'actn'}</th> |
<tr bgcolor="$tabcol" align="center"> |
<th><a href="javascript:changeSort('fullname')">$lt{'name'}</a></th> |
<td><b>$lt{'actn'}</b></td> |
<th><a href="javascript:changeSort('username')">$lt{'usnm'}</a></th> |
<td><b><a href="javascript:changeSort('fullname')">$lt{'name'}</a></b></td> |
<th><a href="javascript:changeSort('domain')">$lt{'doma'}</a></th> |
<td><b><a href="javascript:changeSort('username')">$lt{'usnm'}</a></b> |
<th><a href="javascript:changeSort('id')">ID</a></th> |
</td> |
<th><a href="javascript:changeSort('start')">$lt{'stda'}</a></th> |
<td><b><a href="javascript:changeSort('domain')">$lt{'doma'}</a></b></td> |
<th><a href="javascript:changeSort('end')">$lt{'enda'}</a></th> |
<td><b><a href="javascript:changeSort('id')">ID</a></b></td> |
|
<td><b><a href="javascript:changeSort('start')">$lt{'stda'}</a></b></td> |
|
<td><b><a href="javascript:changeSort('end')">$lt{'enda'}</a></b></td> |
|
END |
END |
my $colspan = 0; |
my $colspan = 0; |
if ($hastools) { |
if ($hastools) { |
$r->print('<td><b>'.$lt{'curf'}.'</b></td>'); |
$r->print('<th>'.$lt{'curf'}.'</th>'); |
$colspan ++; |
$colspan++; |
} |
} |
if ($addtools) { |
if ($addtools) { |
$r->print('<td><b>Additional Functionality</b></td>'); |
$r->print('<th>'.&mt('Additional Tools').'</th>'); |
$colspan ++; |
$colspan++; |
} |
} |
$r->print('</tr>'); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
if ($colspan) { |
if ($colspan) { |
if ($granularity eq 'Yes') { |
if ($granularity eq 'Yes') { |
$r->print('<tr bgcolor="#cccccc"> |
$r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').' |
<td colspan="7"> </td> |
<td colspan="7"> </td> |
<td colspan="'.$colspan.'" align="center"><small><nobr><b>'.&mt('All:'). |
<td colspan="'.$colspan.'" align="center"><nobr><b>'.&mt('All:'). |
'</b> '); |
'</b> '); |
foreach my $tool (@{$available}) { |
foreach my $tool (@{$available}) { |
$r->print('<label><input type="checkbox" name="togglefunc"'. |
$r->print('<label><input type="checkbox" name="togglefunc"'. |
' onclick="javascript:toggleTools(document.'.$formname.'.user_'.$tool.',this);"'. |
' onclick="javascript:toggleTools(document.'.$formname.'.user_'.$tool.',this);"'. |
' value="'.$tool.'">'.'<b>'.$tool.'</b></label> '); |
' value="'.$tool.'" />'.'<b>'.$tool.'</b></label> '); |
} |
} |
$r->print('</nobr></small></td></tr>'); |
$r->print('</nobr></td></tr>'); |
} |
} |
} |
} |
my %Sortby = (); |
my %Sortby = (); |
Line 2187 END
|
Line 2218 END
|
push(@{$Sortby{$$current{$user}{fullname}}},$user); |
push(@{$Sortby{$$current{$user}{fullname}}},$user); |
} |
} |
} |
} |
my $rowNum = 0; |
|
my $rowColor; |
|
foreach my $key (sort(keys(%Sortby))) { |
foreach my $key (sort(keys(%Sortby))) { |
foreach my $user (@{$Sortby{$key}}) { |
foreach my $user (@{$Sortby{$key}}) { |
if ($rowNum %2 == 1) { |
|
$rowColor = $rowColor1; |
|
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
my $id = $$current{$user}{id}; |
my $id = $$current{$user}{id}; |
my $fullname = $$current{$user}{fullname}; |
my $fullname = $$current{$user}{fullname}; |
my $udom = $$current{$user}{udom}; |
my $udom = $$current{$user}{udom}; |
my $uname = $$current{$user}{uname}; |
my $uname = $$current{$user}{uname}; |
my $start = $$current{$user}{start}; |
my $start = $$current{$user}{start}; |
my $end = $$current{$user}{end}; |
my $end = $$current{$user}{end}; |
$r->print('<tr bgcolor="'.$rowColor.'"> |
$r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense').' |
<td><small>'); |
<td>'); |
if ($$current{$user}{changestate} eq 'reenable') { |
if ($$current{$user}{changestate} eq 'reenable') { |
$r->print('<nobr><label>'. |
$r->print('<nobr><label>'. |
'<input type="checkbox" name="reenable" value="'.$user.'" />'. |
'<input type="checkbox" name="reenable" value="'.$user.'" />'. |
Line 2226 END
|
Line 2250 END
|
'</label></nobr>'); |
'</label></nobr>'); |
} |
} |
$r->print(' |
$r->print(' |
</td> |
</td>'. |
<td><small>'. |
'<td>'.$fullname.'</td>'. |
$fullname.'</small></td><td><small>'.$uname.'</small></td><td><small>'. |
'<td>'.$uname.'</td>'. |
$udom.'</small></td><td><small>'.$id.'</small></td><td><small>'.$start. |
'<td>'. $udom.'</td>'. |
'</small></td><td><small>'.$end.'</small></td>'); |
'<td>'.$id.'</td>'. |
|
'<td>'.$start.'</td>'. |
|
'<td>'.$end.'</td>'); |
if ($hastools) { |
if ($hastools) { |
$r->print('<td align="left"><small><nobr>'. |
$r->print('<td align="left"><nobr>'. |
' '); |
' '); |
foreach my $tool (@{$$current{$user}{currtools}}) { |
foreach my $tool (@{$$current{$user}{currtools}}) { |
if ($granularity eq 'Yes') { |
if ($granularity eq 'Yes') { |
Line 2248 END
|
Line 2274 END
|
} |
} |
$r->print(' '); |
$r->print(' '); |
} |
} |
$r->print('</nobr></small></td>'); |
$r->print('</nobr></td>'); |
} |
} |
if ($addtools) { |
if ($addtools) { |
$r->print('<td align="left"><small>'); |
$r->print('<td align="left">'); |
if ($granularity eq 'Yes') { |
if ($granularity eq 'Yes') { |
foreach my $tool (@{$$current{$user}{newtools}}) { |
foreach my $tool (@{$$current{$user}{newtools}}) { |
$r->print('<nobr><label><input type="checkbox" |
$r->print('<nobr><label><input type="checkbox" |
Line 2267 END
|
Line 2293 END
|
'</nobr> '); |
'</nobr> '); |
} |
} |
} |
} |
$r->print('</small></td>'); |
$r->print('</td>'); |
} |
} |
$r->print('</tr>'."\n"); |
$r->print(&Apache::loncommon::end_data_table_row()."\n"); |
$rowNum ++; |
|
} |
} |
} |
} |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(' |
} else { |
</td> |
$r->print(&mt('There are no active, future or previous group members to modify.')); |
</tr>'); |
|
} |
} |
return; |
return $numcurrent; |
} |
} |
|
|
sub check_uncheck_buttons { |
sub check_uncheck_buttons { |
my ($r,$formname,$field,$title,$colspan) = @_; |
my ($r,$formname,$field,$title,$colspan) = @_; |
$r->print(' |
$r->print(' |
<td '.$colspan.'> |
<td '.$colspan.'> |
<nobr> |
|
<fieldset> |
<fieldset> |
<legend><b>'.$title.'</b></legend> |
<legend><b>'.$title.'</b></legend> |
|
<nobr> |
<input type="button" value="check all" |
<input type="button" value="check all" |
onclick="javascript:checkAll(document.'.$formname.'.'.$field.')" /> |
onclick="javascript:checkAll(document.'.$formname.'.'.$field.')" /> |
|
|
<input type="button" value="uncheck all" |
<input type="button" value="uncheck all" |
onclick="javascript:uncheckAll(document.'.$formname.'.'.$field.')" /> |
onclick="javascript:uncheckAll(document.'.$formname.'.'.$field.')" /> |
</fieldset> |
|
</nobr> |
</nobr> |
|
</fieldset> |
</td> |
</td> |
'); |
'); |
} |
} |
Line 2323 sub change_privs_form {
|
Line 2347 sub change_privs_form {
|
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) { |
$r->print('<tr><td> </td><td colspan="3"><b>'.$lt{'tode'}.':</b><br /><ul>'); |
$r->print('<b>'.$lt{'tode'}.':</b><br /><ul>'); |
foreach my $user (@{$$memchg{'deletion'}}) { |
foreach my $user (@{$$memchg{'deletion'}}) { |
$r->print('<li>'.$$userdata{$user}[$$idx{fullname}]. |
$r->print('<li>'.$$userdata{$user}[$$idx{fullname}]. |
' ('.$user.')</li>'); |
' ('.$user.')</li>'); |
Line 2334 sub change_privs_form {
|
Line 2358 sub change_privs_form {
|
} |
} |
if (ref($$memchg{'expire'}) eq 'ARRAY') { |
if (ref($$memchg{'expire'}) eq 'ARRAY') { |
if (@{$$memchg{'expire'}} > 0) { |
if (@{$$memchg{'expire'}} > 0) { |
$r->print('<tr><td> </td><td colspan="3"><b>'.$lt{'toex'}.':</b><br /><ul>'); |
$r->print('<b>'.$lt{'toex'}.':</b><br /><ul>'); |
foreach my $user (@{$$memchg{'expire'}}) { |
foreach my $user (@{$$memchg{'expire'}}) { |
$r->print('<li>'.$$userdata{$user}[$$idx{fullname}]. |
$r->print('<li>'.$$userdata{$user}[$$idx{fullname}]. |
' ('.$user.')</li>'); |
' ('.$user.')</li>'); |
Line 2347 sub change_privs_form {
|
Line 2371 sub change_privs_form {
|
$r->print($lt{'nome'}.'<br />'); |
$r->print($lt{'nome'}.'<br />'); |
} |
} |
|
|
&topic_bar($r,4,&mt('[_1] member privileges',$ucgpterm)); |
&topic_bar($r,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 2364 sub change_privs_form {
|
Line 2388 sub change_privs_form {
|
} |
} |
|
|
sub add_members_form { |
sub add_members_form { |
my ($r,$action,$formname,$page,$startdate,$enddate,$groupname, |
my ($r,$cdom,$cnum,$action,$formname,$page,$startdate,$enddate,$groupname, |
$description,$granularity,$quota,$sectioncount,$tools,$functions, |
$description,$granularity,$quota,$sectioncount,$tools,$functions, |
$stored,$states,$navbuttons,$gpterm,$ucgpterm)=@_; |
$stored,$states,$navbuttons,$gpterm,$ucgpterm)=@_; |
$r->print(' <br />'); |
$r->print(' <br />'); |
Line 2374 sub add_members_form {
|
Line 2398 sub add_members_form {
|
&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); |
&membership_options($r,$action,$formname,$sectioncount,1,$gpterm,$ucgpterm); |
&membership_options($r,$cdom,$cnum,$action,$formname,$sectioncount,1,$gpterm, |
|
$ucgpterm); |
my $nexttext = $$navbuttons{'gtns'}; |
my $nexttext = $$navbuttons{'gtns'}; |
my $prevtext = $$navbuttons{'gtpp'}; |
my $prevtext = $$navbuttons{'gtpp'}; |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
Line 2403 sub choose_privs_form {
|
Line 2428 sub choose_privs_form {
|
$nexttext = $$navbuttons{'adme'}; |
$nexttext = $$navbuttons{'adme'}; |
} |
} |
|
|
&topic_bar($r,6,&mt('[_1] member privileges',$ucgpterm)); |
&topic_bar($r,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, |
$states,$stored,$gpterm); |
$states,$stored,$gpterm); |
|
|
if ($action eq 'create') { |
if ($action eq 'create') { |
if (keys(%{$sectioncount}) > 0) { |
my $img1 = 7; |
my $img1 = 7; |
my $img2 = 8; |
my $img2 = 8; |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
$states,$stored,$navbuttons,$img1,$img2, |
$states,$stored,$navbuttons,$img1,$img2, |
$gpterm,$ucgpterm,$crstype,$cdom,$cnum); |
$gpterm,$ucgpterm,$crstype); |
|
} |
|
} |
} |
my $prevtext = $$navbuttons{'gtps'}; |
my $prevtext = $$navbuttons{'gtps'}; |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
Line 2487 sub member_privileges_form {
|
Line 2510 sub member_privileges_form {
|
$usertools,$idx,$memchg,$states,$stored,$gpterm) = @_; |
$usertools,$idx,$memchg,$states,$stored,$gpterm) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'addp' => 'Additional privileges', |
'addp' => 'Additional privileges', |
'fixp' => 'Fixed privileges', |
'fixp' => 'Core privileges', |
'oppr' => 'Optional privileges', |
'oppr' => 'Optional privileges', |
'func' => 'Function', |
'func' => 'Tool', |
'forf' => 'For the functionality you have chosen to include '. |
'forf' => 'For the collaborative tools included for group '. |
'there are no optional privileges to set besides '. |
'members being added or modified, '. |
'the standard privileges.', |
'there are no optional privileges to set '. |
'algr' => "All $gpterm members will receive the same privileges.", |
'for specific members.', |
'asno' => "As no $gpterm members are being added, ". |
'algr' => 'All new group members will receive the same privileges.', 'ifex' => 'If previously expired members are being re-enabled, or '. |
"there are no specific user privileges to set.", |
'if access for future members is being activated now, '. |
'asng' => "As no $gpterm tools will be made available to users, ". |
'previously set privileges will be preserved.', |
"there are no specific user privileges to set.", |
'asno' => 'As no group members are being added, '. |
'nogm' => "No $gpterm member privileges to display or set, ". |
'there are no specific user privileges to set.', |
"as you have not indicated that you will be activating,". |
'asng' => 'As no group tools will be made available to users, '. |
" re-enabling, changing privileges, or adding/removing ". |
'there are no specific user privileges to set.', |
"functionality for any current members ", |
'nogm' => 'No group member privileges to display or set, '. |
|
'as you have not indicated that you will be activating,'. |
|
' re-enabling, changing privileges, or adding/removing '. |
|
'tools for any current members.', |
'full' => 'Fullname', |
'full' => 'Fullname', |
'user' => 'Username', |
'user' => 'Username', |
'doma' => 'Domain', |
'doma' => 'Domain', |
Line 2627 END
|
Line 2653 END
|
} |
} |
} else { |
} else { |
if (keys(%{$usertools}) > 0) { |
if (keys(%{$usertools}) > 0) { |
$r->print($lt{'algr'}.'<br /><br />'); |
$r->print($lt{'algr'}.'<br />'.$lt{'ifex'}.'<br /><br />'); |
&display_defprivs($r,$tools,$toolprivs,\@defprivs); |
&display_defprivs($r,$tools,$toolprivs,\@defprivs); |
} else { |
} else { |
$r->print($lt{'asno'}.'<br />'); |
$r->print($lt{'asno'}.'<br />'); |
Line 2739 sub write_group_data {
|
Line 2765 sub write_group_data {
|
} |
} |
if ($quota > $maxposs) { |
if ($quota > $maxposs) { |
$quota = $maxposs; |
$quota = $maxposs; |
$r->print(&mt('The value you entered for the quota for the file repository in this [_1] exceeded the maximum possible value, so it has been set to [_2] Mb (the maximum possible value).<br />',$gpterm,$maxposs)); |
$r->print(&mt('The value you entered for the quota for the file repository in this [_1] exceeded the maximum possible value, so it has been set to [_2] Mb (the maximum possible value).<br />',$gpterm,sprintf("%.2f",$maxposs))); |
} |
} |
my %groupinfo = ( |
my %groupinfo = ( |
description => $esc_description, |
description => $esc_description, |
Line 2808 sub write_group_data {
|
Line 2834 sub write_group_data {
|
$r->print(&mt('A problem occurred when creating folders for the new [_1]. [_2].<br />',$gpterm,$result)); |
$r->print(&mt('A problem occurred when creating folders for the new [_1]. [_2].<br />',$gpterm,$result)); |
} |
} |
$r->print(&mt('[_1] [_2] was created.<br />',$ucgpterm,$groupname)); |
$r->print(&mt('[_1] [_2] was created.<br />',$ucgpterm,$groupname)); |
} else { |
} elsif ($action eq 'modify') { |
|
my (@oldtools,@newtools); |
|
if (ref($$stored{'tool'}) eq 'ARRAY') { |
|
@oldtools = @{$$stored{'tool'}}; |
|
} |
|
if (ref($tools) eq 'ARRAY') { |
|
@newtools = @{$tools}; |
|
} |
|
if (!grep(/^discussion$/,@oldtools) && |
|
grep(/^discussion$/,@newtools)) { |
|
my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/'; |
|
my $boardsmap = $crspath.'group_boards_'.$groupname.'.sequence'; |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
my $bbmapres = $navmap->getResourceByUrl($boardsmap); |
|
undef($navmap); |
|
if (!$bbmapres) { |
|
my $grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; |
|
my $disctitle = &mt('Discussion Boards'); |
|
my $outcome = &map_updater($cdom,$cnum,'group_boards_'. |
|
$groupname.'.sequence','bbseq', |
|
$disctitle,$grpmap); |
|
my ($furl,$ferr) = |
|
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
|
$navmap = Apache::lonnavmaps::navmap->new(); |
|
# modify parameter |
|
if ($outcome eq 'ok') { |
|
my $parm_result = &parm_setter($navmap,$cdom,$boardsmap, |
|
$groupname); |
|
if ($parm_result) { |
|
$r->print(&mt('Error while setting parameters '. |
|
'for Discussion Boards folder: '. |
|
'[_1]<br />.',$parm_result)); |
|
} else { |
|
$r->print(&mt('Discussion Boards Folder created.<br />')); |
|
} |
|
} else { |
|
$r->print($outcome); |
|
} |
|
undef($navmap); |
|
} |
|
} |
$r->print(&mt('[_1] [_2] was updated.<br />',$ucgpterm,$groupname)); |
$r->print(&mt('[_1] [_2] was updated.<br />',$ucgpterm,$groupname)); |
} |
} |
} else { |
} else { |
Line 3028 sub process_membership {
|
Line 3094 sub process_membership {
|
} |
} |
if ($roster_result eq 'ok') { |
if ($roster_result eq 'ok') { |
$r->print('<br />'.&mt('[_1] membership list updated.',$ucgpterm)); |
$r->print('<br />'.&mt('[_1] membership list updated.',$ucgpterm)); |
$r->print('<p>'.&mt("For full access to all of [_1]'s privileges, users will need to log out and log back in.",$groupname).'</p>'); |
$r->print('<p>'.&mt("Any currently logged in course users affected by the changes you made to group membership or privileges for the [_1] group will need to log out and log back in for their LON-CAPA sessions to reflect these changes.",$groupname).'</p>'); |
} else { |
} else { |
$r->print('<br />'.&mt('An error occurred while updating the [_1] membership list -',$gpterm).$roster_result.'<br />'); |
$r->print('<br />'.&mt('An error occurred while updating the [_1] membership list -',$gpterm).$roster_result.'<br />'); |
} |
} |
Line 3037 sub process_membership {
|
Line 3103 sub process_membership {
|
|
|
sub mapping_options { |
sub mapping_options { |
my ($r,$action,$formname,$page,$sectioncount,$states,$stored, |
my ($r,$action,$formname,$page,$sectioncount,$states,$stored, |
$navbuttons,$img1,$img2,$gpterm,$ucgpterm,$crstype) = @_; |
$navbuttons,$img1,$img2,$gpterm,$ucgpterm,$crstype,$cdom,$cnum) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'auto' => "Settings for automatic $gpterm enrollment", |
'auto' => "Settings for automatic $gpterm enrollment", |
'gmma' => "$ucgpterm membership mapping to specific sections/roles", |
'gmma' => "$ucgpterm membership mapping to specific sections/roles", |
'endi' => "Enable/disable automatic $gpterm enrollment for ". |
'endi' => "Enable/disable automatic $gpterm enrollment for ". |
"users in specified roles and sections", |
"users in specified roles and sections", |
'adds' => "If automatic $gpterm enrollment is enabled, when a user is assigned a ".lc($crstype)."-wide or section-specific role, he/she will automatically be added as a member of the $gpterm, with start and end access dates defined by the default dates set for the $gpterm, unless he/she is already a $gpterm member, with access dates that permit either current or future $gpterm access.", |
'adds' => "If automatic $gpterm enrollment is enabled, when a user is newly assigned a ".lc($crstype)."-wide or section-specific role, he/she will automatically be added as a member of the $gpterm, with start and end access dates defined by the default dates set for the $gpterm, unless he/she is already a $gpterm member, with access dates that permit either current or future $gpterm access.", |
'drops' => "If automatic $gpterm disenrollment is enabled, when a user's role is expired, access to the $gpterm will be terminated unless the user continues to have other ".lc($crstype)."-wide or section-specific active or future roles which receive automatic membership in the $gpterm.", |
'drops' => "If automatic $gpterm disenrollment is enabled, when a user's role is expired, access to the $gpterm will be terminated unless the user continues to have other ".lc($crstype)."-wide or section-specific active or future roles which receive automatic membership in the $gpterm.", |
'pirs' => "Pick roles and sections for automatic $gpterm enrollment", |
'pirs' => "Pick roles and sections for automatic $gpterm enrollment", |
'curr' => 'Currently set to', |
'curr' => 'Currently set to', |
Line 3054 sub mapping_options {
|
Line 3120 sub mapping_options {
|
'mapr' => "Mapping of roles and sections affected by automatic $gpterm enrollment/disenrollment follows scheme chosen below.", |
'mapr' => "Mapping of roles and sections affected by automatic $gpterm enrollment/disenrollment follows scheme chosen below.", |
); |
); |
&automapping($r,$action,$stored,\%lt,$img1); |
&automapping($r,$action,$stored,\%lt,$img1); |
&mapping_settings($r,$sectioncount,\%lt,$stored,$img2,$crstype); |
&mapping_settings($r,$sectioncount,\%lt,$stored,$img2,$crstype,$cdom,$cnum, |
|
$action); |
return; |
return; |
} |
} |
|
|
Line 3087 sub automapping {
|
Line 3154 sub automapping {
|
} |
} |
|
|
sub mapping_settings { |
sub mapping_settings { |
my ($r,$sectioncount,$lt,$stored,$image,$crstype) = @_; |
my ($r,$sectioncount,$lt,$stored,$image,$crstype,$cdom,$cnum,$action) = @_; |
my @sections = keys(%{$sectioncount}); |
my @sections = keys(%{$sectioncount}); |
if (@sections > 0) { |
if (@sections > 0) { |
@sections = sort {$a cmp $b} @sections; |
@sections = sort {$a cmp $b} @sections; |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
|
} else { |
|
@sections = ('all','none'); |
} |
} |
&topic_bar($r,$image,$$lt{'pirs'}); |
&topic_bar($r,$image,$$lt{'pirs'}); |
my @roles = &standard_roles(); |
my @roles = &standard_roles(); |
my %customroles = &my_custom_roles(); |
my %customroles = &Apache::lonhtmlcommon::course_custom_roles($cdom,$cnum); |
$r->print(&Apache::loncommon::start_data_table(). |
$r->print(&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row()); |
&Apache::loncommon::start_data_table_header_row()); |
$r->print(' |
$r->print(' |
Line 3107 sub mapping_settings {
|
Line 3176 sub mapping_settings {
|
} |
} |
$r->print(&Apache::loncommon::end_data_table_header_row()."\n"); |
$r->print(&Apache::loncommon::end_data_table_header_row()."\n"); |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $plrole=&Apache::lonnet::plaintext($role,$crstype); |
my $roletitle=&Apache::lonnet::plaintext($role,$crstype); |
my $sections_sel; |
$r->print(&print_autorole_item($role,$roletitle,\@sections)); |
if (@sections > 0) { |
|
if ($role eq 'cc') { |
|
$sections_sel = '<td align="right">'. |
|
&mt('all sections').'<input type="hidden" '. |
|
'name="sec_cc" value="all" /></td>'; |
|
} else { |
|
$sections_sel='<td align="right">'. |
|
§ions_selection(\@sections,'sec_'.$role). |
|
'</td>'; |
|
} |
|
} |
|
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td><input type="checkbox" '. |
|
'name="autorole" value="'.$role.'" /></td><td>'.$plrole. |
|
'</td>'.$sections_sel. |
|
&Apache::loncommon::end_data_table_row()); |
|
} |
} |
|
my @customs; |
foreach my $role (sort(keys(%customroles))) { |
foreach my $role (sort(keys(%customroles))) { |
my $sections_sel; |
my ($roletitle) = ($role =~ m|^cr/[^/]+/[^/]+/(.+)$|); |
if (@sections > 0) { |
push (@customs,$role); |
$sections_sel = |
$r->print(&print_autorole_item($role,$roletitle,\@sections)); |
'<td>'.§ions_selection(\@sections,'sec_'.$role).'</td>'; |
} |
} |
if ($action eq 'modify') { |
$r->print(&Apache::loncommon::start_data_table_row(). |
foreach my $role (@{$$stored{'autorole'}}) { |
'<td><input type="checkbox" '. |
if ((!grep(/^\Q$role\E$/,@customs)) && |
'value="'.$role.'" /></td><td>'.$role.'</td>'. |
(!grep(/^\Q$role\E$/,@roles))) { |
$sections_sel. |
my $roletitle; |
&Apache::loncommon::end_data_table_row()); |
if ($role =~ /^cr/) { |
|
($roletitle) = ($role =~ m|_([^_]+)$|); |
|
} else { |
|
$roletitle = &Apache::lonnet::plaintext($role,$crstype); |
|
} |
|
$r->print(&print_autorole_item($role,$roletitle,\@sections)); |
|
} |
|
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
return; |
return; |
} |
} |
|
|
|
sub print_autorole_item { |
|
my ($role,$roletitle,$sections) = @_; |
|
my $sections_sel; |
|
if (@{$sections} > 0) { |
|
if ($role eq 'cc') { |
|
$sections_sel = '<td align="right">'. |
|
&mt('all sections').'<input type="hidden" '. |
|
'name="sec_cc" value="all" /></td>'; |
|
} else { |
|
$sections_sel='<td align="right">'. |
|
§ions_selection($sections,'sec_'.$role). |
|
'</td>'; |
|
} |
|
} |
|
my $output = &Apache::loncommon::start_data_table_row(). |
|
'<td><input type="checkbox" '. |
|
'name="autorole" value="'.$role.'" />'. |
|
'</td><td>'.$roletitle.'</td>'.$sections_sel. |
|
&Apache::loncommon::end_data_table_row(); |
|
return $output; |
|
} |
|
|
sub standard_roles { |
sub standard_roles { |
my @roles = ('cc','in','ta','ep','st'); |
my @roles = ('cc','in','ta','ep','st'); |
return @roles; |
return @roles; |
} |
} |
|
|
sub my_custom_roles { |
|
my %returnhash=(); |
|
my %rolehash=&Apache::lonnet::dump('roles'); |
|
foreach (keys %rolehash) { |
|
if ($_=~/^rolesdef\_(\w+)$/) { |
|
$returnhash{$1}=$1; |
|
} |
|
} |
|
return %returnhash; |
|
} |
|
|
|
sub modify_menu { |
sub modify_menu { |
my ($r,$groupname,$page,$gpterm) = @_; |
my ($r,$groupname,$page,$gpterm) = @_; |
my @menu = |
my @menu = |
Line 3210 sub member_privs_entries {
|
Line 3282 sub member_privs_entries {
|
<td>'.$$userdata{$user}[$$idx{fullname}].'</td> |
<td>'.$$userdata{$user}[$$idx{fullname}].'</td> |
<td>'.$uname.'</td> |
<td>'.$uname.'</td> |
<td>'.$udom.'</td> |
<td>'.$udom.'</td> |
<td valign="top"><table><tr><td><b>Function</b></td></tr><tr><td><b>Fixed</b></td></tr><tr><td><b>Optional</b></td></tr></table></td>'); |
<td valign="top"> |
|
<table> |
|
<tr> |
|
<td><b>'. |
|
&mt('Collaborative Tool').'</b></td> |
|
</tr> |
|
<tr> |
|
<td><b>'.&mt('Fixed').'</b></td> |
|
</tr> |
|
<tr> |
|
<td><b>'.&mt('Optional').'</b></td> |
|
</tr> |
|
</table> |
|
</td>'); |
foreach my $tool (@{$showtools}) { |
foreach my $tool (@{$showtools}) { |
if (exists($$usertools{$user}{$tool})) { |
if (exists($$usertools{$user}{$tool})) { |
$r->print('<td valign="top"><table><tr><th colspan="2">'.$tool.'</th></tr>'); |
$r->print('<td valign="top"><table><tr><th colspan="2">'.$tool.'</th></tr>'); |
Line 3289 sub add_group_folder {
|
Line 3374 sub add_group_folder {
|
if ($action eq 'create') { |
if ($action eq 'create') { |
# check if group_allfolders.sequence exists. |
# check if group_allfolders.sequence exists. |
if (!$topmap) { |
if (!$topmap) { |
my $grpstitle = &mt('[_1] [_2]',$crstype,$ucgpterm); |
my $grpstitle = &mt('[_1] [_2]s',$crstype,$ucgpterm); |
my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'}; |
my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'}; |
$topmap_url =~ s|/+|/|g; |
$topmap_url =~ s|/+|/|g; |
if ($topmap_url =~ m|^/uploaded|) { |
if ($topmap_url =~ m|^/uploaded|) { |
Line 3304 sub add_group_folder {
|
Line 3389 sub add_group_folder {
|
} |
} |
} |
} |
my $grpfolder = &mt('[_1] Folder -',$ucgpterm,).$description; |
my $grpfolder = &mt('[_1] Folder -',$ucgpterm,).$description; |
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/grppg'; |
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/smppg'; |
my $grptitle = &mt('Group homepage').' - '.$description; |
my $grptitle = &mt('Group homepage').' - '.$description; |
my ($seqid,$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, |
$grptitle); |
$grptitle); |
Line 3318 sub add_group_folder {
|
Line 3403 sub add_group_folder {
|
# Link to folder for bulletin boards |
# Link to folder for bulletin boards |
$grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; |
$grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; |
if (grep/^discussion$/,@{$tools}) { |
if (grep/^discussion$/,@{$tools}) { |
$seqid = $now + 1; |
|
$disctitle = &mt('Discussion Boards'); |
$disctitle = &mt('Discussion Boards'); |
my $outcome = &map_updater($cdom,$cnum,'group_boards_'.$groupname. |
my $outcome = &map_updater($cdom,$cnum,'group_boards_'.$groupname. |
'.sequence','bbseq',$disctitle,$grpmap); |
'.sequence','bbseq',$disctitle,$grpmap); |
Line 3335 sub add_group_folder {
|
Line 3419 sub add_group_folder {
|
# modify parameters |
# modify parameters |
my $parm_result; |
my $parm_result; |
if ($action eq 'create') { |
if ($action eq 'create') { |
if ($allgrpsmap) { |
|
$parm_result .= &parm_setter($navmap,$cdom,$allgrpsmap,$groupname); |
|
} |
|
if ($grpmap) { |
if ($grpmap) { |
$parm_result .= &parm_setter($navmap,$cdom,$grpmap,$groupname); |
$parm_result .= &parm_setter($navmap,$cdom,$grpmap,$groupname); |
} |
} |
Line 3367 sub map_updater {
|
Line 3448 sub map_updater {
|
$outcome = &mt('Error uploading new folder.')." ($newfile): $newmapurl".'<br />'; |
$outcome = &mt('Error uploading new folder.')." ($newfile): $newmapurl".'<br />'; |
return $outcome; |
return $outcome; |
} |
} |
my ($errtext,$fatal)=&Apache::lonratedt::mapread($parentmap); |
my ($errtext,$fatal)=&LONCAPA::map::mapread($parentmap); |
if ($fatal) { |
if ($fatal) { |
$outcome = &mt('Error reading contents of parent folder')." ($parentmap): $errtext".'<br />'; |
$outcome = &mt('Error reading contents of parent folder')." ($parentmap): $errtext".'<br />'; |
return $outcome; |
return $outcome; |
} else { |
} else { |
my $newidx=&Apache::lonratedt::getresidx($newmapurl); |
my $newidx=&LONCAPA::map::getresidx($newmapurl); |
$Apache::lonratedt::resources[$newidx] = $itemtitle.':'.$newmapurl. |
$LONCAPA::map::resources[$newidx] = $itemtitle.':'.$newmapurl. |
':false:normal:res'; |
':false:normal:res'; |
$Apache::lonratedt::order[1+$#Apache::lonratedt::order]=$newidx; |
$LONCAPA::map::order[1+$#LONCAPA::map::order]=$newidx; |
my ($outtext,$errtext) = &Apache::lonratedt::storemap($parentmap,1); |
my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1); |
if ($errtext) { |
if ($errtext) { |
$outcome = &mt('Error storing updated parent folder')." ($parentmap): $errtext".'<br />'; |
$outcome = &mt('Error storing updated parent folder')." ($parentmap): $errtext".'<br />'; |
return $outcome; |
return $outcome; |