version 1.51, 2010/03/15 19:10:59
|
version 1.54, 2010/05/18 16:13:31
|
Line 208 sub print_course_selection_page {
|
Line 208 sub print_course_selection_page {
|
sub print_modification_menu { |
sub print_modification_menu { |
my ($r,$cdesc,$domdesc,$dom,$type) = @_; |
my ($r,$cdesc,$domdesc,$dom,$type) = @_; |
&print_header($r,$type); |
&print_header($r,$type); |
my ($ccrole,$setquota_text,$setparams_text,$cat_text); |
my ($ccrole,$categorytitle,$setquota_text,$setparams_text,$cat_text); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$ccrole = 'co'; |
$ccrole = 'co'; |
} else { |
} else { |
$ccrole = 'cc'; |
$ccrole = 'cc'; |
} |
} |
my $action = '/adm/modifycourse'; |
|
if ($type eq 'Community') { |
if ($type eq 'Community') { |
|
$categorytitle = 'View/Modify Community Settings'; |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.'); |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.'); |
$setparams_text = 'View/Modify community owner'; |
$setparams_text = 'View/Modify community owner'; |
$cat_text = 'View/Modify catalog settings for community'; |
$cat_text = 'View/Modify catalog settings for community'; |
} else { |
} else { |
|
$categorytitle = 'View/Modify Course Settings'; |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.'); |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.'); |
$setparams_text = 'View/Modify course owner, institutional code, and default authentication'; |
$setparams_text = 'View/Modify course owner, institutional code, and default authentication'; |
$cat_text = 'View/Modify catalog settings for course'; |
$cat_text = 'View/Modify catalog settings for course'; |
} |
} |
my @menu = |
|
( |
|
{ text => $setparams_text, |
|
phase => 'setparms', |
|
}, |
|
{ text => 'View/Modify quota for group portfolio files', |
|
phase => 'setquota', |
|
} |
|
); |
|
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); |
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); |
my @additional_params = &catalog_settable($domconf{'coursecategories'},$type); |
my @additional_params = &catalog_settable($domconf{'coursecategories'},$type); |
if (@additional_params > 0) { |
|
push (@menu, { text => $cat_text, |
sub phaseurl { |
phase => 'catsettings', |
my $phase = shift; |
}); |
return "javascript:changePage(document.menu,'$phase')" |
} |
} |
unless ($type eq 'Community') { |
my @menu = |
push(@menu, |
({ categorytitle => $categorytitle, |
{ text => 'Display current settings for automated enrollment', |
items => [ |
phase => 'viewparms', |
{ |
} |
linktext => $setparams_text, |
|
url => &phaseurl('setparms'), |
|
permission => 1, |
|
#help => '', |
|
icon => 'mcrs.png', |
|
linktitle => '' |
|
}, |
|
{ |
|
linktext => 'View/Modify quota for group portfolio files', |
|
url => &phaseurl('setquota'), |
|
permission => 1, |
|
#help => '', |
|
icon => 'mcrs.png', |
|
linktitle => '' |
|
}, |
|
{ |
|
linktext => $cat_text, |
|
url => &phaseurl('catsettings'), |
|
permission => (@additional_params > 0), |
|
#help => '', |
|
icon => 'mcrs.png', |
|
linktitle => '' |
|
}, |
|
{ |
|
linktext => 'Display current settings for automated enrollment', |
|
url => &phaseurl('viewparms'), |
|
permission => ($type ne 'Community'), |
|
#help => '', |
|
icon => 'mcrs.png', |
|
linktitle => '' |
|
}, |
|
] |
|
}, |
); |
); |
} |
|
my $menu_html = '<h3>'.&mt('View/Modify settings for: '). |
my $menu_html = |
' <span class="LC_nobreak">'.$cdesc.'</span></h3>'."\n"; |
'<h3>' |
|
.&mt('View/Modify settings for: [_1]', |
|
'<span class="LC_nobreak">'.$cdesc.'</span>') |
|
.'</h3>'."\n".'<p>'; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$menu_html .= &mt('Although almost all community settings can be modified by a Coordinator, the following may only be set or modified by a Domain Coordinator:'); |
$menu_html .= &mt('Although almost all community settings can be modified by a Coordinator, the following may only be set or modified by a Domain Coordinator:'); |
} else { |
} else { |
$menu_html .= &mt('Although almost all course settings can be modified by a Course Coordinator, the following may only be set or modified by a Domain Coordinator:'); |
$menu_html .= &mt('Although almost all course settings can be modified by a Course Coordinator, the following may only be set or modified by a Domain Coordinator:'); |
} |
} |
$menu_html .= '<ul>'; |
$menu_html .= '</p>'."\n".'<ul>'; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'; |
$menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'; |
} else { |
} else { |
Line 265 sub print_modification_menu {
|
Line 293 sub print_modification_menu {
|
foreach my $item (@additional_params) { |
foreach my $item (@additional_params) { |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
if ($item eq 'togglecats') { |
if ($item eq 'togglecats') { |
$menu_html .= ' <li>'.&mt('Hiding/unhiding a community from the catalog (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
$menu_html .= ' <li>'.&mt('Hiding/unhiding a community from the catalog (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
} elsif ($item eq 'categorize') { |
} elsif ($item eq 'categorize') { |
$menu_html .= ' <li>'.&mt('Manual cataloging of a community (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
$menu_html .= ' <li>'.&mt('Manual cataloging of a community (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
} |
} |
} else { |
} else { |
if ($item eq 'togglecats') { |
if ($item eq 'togglecats') { |
$menu_html .= ' <li>'.&mt('Hiding/unhiding a course from the course catalog (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
$menu_html .= ' <li>'.&mt('Hiding/unhiding a course from the course catalog (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
} elsif ($item eq 'categorize') { |
} elsif ($item eq 'categorize') { |
$menu_html .= ' <li>'.&mt('Manual cataloging of a course (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
$menu_html .= ' <li>'.&mt('Manual cataloging of a course (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n"; |
} |
} |
} |
} |
} |
} |
$menu_html .= ' </ul> |
$menu_html .= |
<form name="menu" method="post" action="'.$action.'" />'."\n". |
' </ul>' |
&hidden_form_elements(); |
.'<form name="menu" method="post" action="/adm/modifycourse">' |
foreach my $menu_item (@menu) { |
."\n" |
$menu_html.='<h3>'; |
.&hidden_form_elements(); |
$menu_html.= |
|
qq|<a href="javascript:changePage(document.menu,'$menu_item->{'phase'}')">|; |
|
$menu_html.= &mt($menu_item->{'text'}).'</a>'; |
|
$menu_html.='</h3>'; |
|
} |
|
|
|
$r->print($menu_html); |
$r->print($menu_html); |
|
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
|
$r->print('</form>'); |
return; |
return; |
} |
} |
|
|
Line 779 sub modify_course {
|
Line 804 sub modify_course {
|
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'}); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
|
|
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]" automated enrollment may fail for "[_2]" - section: [_3], for the following reason: "[_4]"',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>'); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>'); |
} |
} |
} else { |
} else { |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]" automated enrollment may fail for "[_2]" - section: [_3], for the following reason: "[_4]"',$description,$newattr{'coursecode'},$instsec,$course_check)); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$course_check)); |
} |
} |
} else { |
} else { |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3], because this is not a valid section entry.',$description,$newattr{'coursecode'},$sec)); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3], because this is not a valid section entry.',$description,$newattr{'coursecode'},$sec)); |
Line 795 sub modify_course {
|
Line 820 sub modify_course {
|
my $inst_course_id = $newattr{'coursecode'}.$instsec; |
my $inst_course_id = $newattr{'coursecode'}.$instsec; |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'}); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome)); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome)); |
} |
} |
} else { |
} else { |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section [_3] because this is not a valid section entry.',$description,$newattr{'coursecode'},$sec)); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3], because this is not a valid section entry.',$description,$newattr{'coursecode'},$sec)); |
} |
} |
} |
} |
} |
} |
} else { |
} else { |
push(@warnings,&mt('As no section numbers are currently listed for "[_1]" automated enrollment will not occur for any sections of institutional course code: "[_2]".',$description,$newattr{'coursecode'})); |
push(@warnings,&mt('As no section numbers are currently listed for "[_1]", automated enrollment will not occur for any sections of institutional course code: "[_2]".',$description,$newattr{'coursecode'})); |
} |
} |
if ( (@xlists > 0) && ($changed{'owner'}) ) { |
if ( (@xlists > 0) && ($changed{'owner'}) ) { |
foreach my $xlist (@xlists) { |
foreach my $xlist (@xlists) { |
Line 931 sub update_coowners {
|
Line 956 sub update_coowners {
|
my %pendinghash = ( |
my %pendinghash = ( |
'internal.pendingco-owners' => $pendingcoowners, |
'internal.pendingco-owners' => $pendingcoowners, |
); |
); |
my $putresult = &put('environment',\%pendinghash,$cdom,$cnum); |
my $putresult = &Apache::lonnet::put('environment',\%pendinghash,$cdom,$cnum); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if ($env{'course.'.$cid.'.num'} eq $cnum) { |
if ($env{'course.'.$cid.'.num'} eq $cnum) { |
&appenv({'course.'.$cid.'.internal.pendingco-owners' => $pendingcoowners}); |
&Apache::lonnet::appenv({'course.'.$cid.'.internal.pendingco-owners' => $pendingcoowners}); |
} |
} |
} |
} |
} else { |
} else { |