version 1.36, 2007/12/14 00:24:11
|
version 1.37, 2007/12/30 23:22:41
|
Line 108 sub print_course_search_page {
|
Line 108 sub print_course_search_page {
|
my $action = '/adm/modifycourse'; |
my $action = '/adm/modifycourse'; |
my $cctitle = &Apache::lonnet::plaintext('cc',$type); |
my $cctitle = &Apache::lonnet::plaintext('cc',$type); |
my $dctitle = &Apache::lonnet::plaintext('dc'); |
my $dctitle = &Apache::lonnet::plaintext('dc'); |
my %lt=&Apache::lonlocal::texthash( |
$r->print( |
'some' => "Certain settings which control auto-enrollment of students from your institution's student information system.", |
'<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'. |
'crqo' => 'The total disk space allocated for storage of portfolio files in all groups in a course.', |
&mt('Actions available after selecting a course:').'<ul>'. |
'tmod' => 'To view or modify these settings use the criteria below to select a course from this domain.', |
'<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n". |
); |
'<li>'.&mt('View or modify course settings which only a [_1] may modify.' |
$r->print('<h3>'. |
,$dctitle).'</li>'."\n".'</ul>'); |
&mt('Course settings which only a [_1] may modify.' |
|
,$dctitle).'</h3>'. |
|
&mt('Although almost all course settings can be modified by a [_1], a number of settings exist which only a [_2] may change:',$cctitle,$dctitle).' |
|
<ul> |
|
<li>'.$lt{'some'}.'</li> |
|
<li>'.$lt{'crqo'}.'</li> |
|
</ul>'. |
|
$lt{'tmod'}.' ('.$domdesc.') |
|
<br /><br /> |
|
'); |
|
$r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, |
$r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, |
undef,undef,$filter,$action,'modifycourse')); |
undef,undef,$filter,$action,'modifycourse')); |
} |
} |
Line 149 sub print_course_selection_page {
|
Line 139 sub print_course_selection_page {
|
$filter{'domainfilter'} = $dom; |
$filter{'domainfilter'} = $dom; |
my %courses = &Apache::lonpickcourse::search_courses($r,$type,0, |
my %courses = &Apache::lonpickcourse::search_courses($r,$type,0, |
\%filter); |
\%filter); |
if (keys(%courses) > 0) { |
|
$r->print(&mt("Click a 'Select' button to view or modify settings for a [_1] which may only be modified by a [_2] in this domain.",lc($type),$dctitle).'<br /><br />'); |
|
} |
|
|
|
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action, |
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action, |
%courses); |
%courses); |
return; |
return; |
} |
} |
|
|
sub print_modification_menu { |
sub print_modification_menu { |
my ($r,$cdesc) = @_; |
my ($r,$cdesc,$domdesc) = @_; |
&print_header($r,$cdesc); |
&print_header($r,$cdesc); |
|
my $type = 'Course'; |
|
my $action = '/adm/modifycourse'; |
|
my $cctitle = &Apache::lonnet::plaintext('cc',$type); |
|
my $dctitle = &Apache::lonnet::plaintext('dc'); |
|
my %lt=&Apache::lonlocal::texthash( |
|
'some' => "Certain settings which control auto-enrollment of students from your institution's student information system.", |
|
'crqo' => 'The total disk space allocated for storage of portfolio files in all groups in a course.', |
|
); |
my @menu = |
my @menu = |
( |
( |
{ text => 'Modify quota for group portfolio files', |
{ text => 'Modify quota for group portfolio files', |
Line 174 sub print_modification_menu {
|
Line 168 sub print_modification_menu {
|
} |
} |
); |
); |
my $menu_html = '<h3>'.&mt('View/Modify settings for: ').$cdesc.'</h3>'."\n". |
my $menu_html = '<h3>'.&mt('View/Modify settings for: ').$cdesc.'</h3>'."\n". |
'<form name="menu" method="post" action="/adm/modifycourse" />'."\n". |
&mt('Although almost all course settings can be modified by a [_1], a number of settings exist which only a [_2] may change:',$cctitle,$dctitle).' |
&hidden_form_elements(); |
<ul> |
|
<li>'.$lt{'some'}.'</li> |
|
<li>'.$lt{'crqo'}.'</li> |
|
</ul> |
|
<form name="menu" method="post" action="'.$action.'" />'."\n". |
|
&hidden_form_elements(); |
|
|
foreach my $menu_item (@menu) { |
foreach my $menu_item (@menu) { |
$menu_html.='<p>'; |
$menu_html.='<p>'; |
$menu_html.='<font size="+1">'; |
$menu_html.='<font size="+1">'; |
Line 189 sub print_modification_menu {
|
Line 189 sub print_modification_menu {
|
return; |
return; |
} |
} |
|
|
|
sub print_ccrole_selected { |
|
my ($r,$cdesc,$domdesc) = @_; |
|
&print_header($r); |
|
my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'}); |
|
$r->print('<form name="ccrole" method="post" action="/adm/roles"> |
|
<input type="hidden" name="selectrole" value="1" /> |
|
<input type="hidden" name="newrole" value="cc./'.$cdom.'/'.$cnum.'" /> |
|
</form>'); |
|
} |
|
|
sub print_settings_display { |
sub print_settings_display { |
my ($r,$cdom,$cnum,$cdesc,$type) = @_; |
my ($r,$cdom,$cnum,$cdesc,$type) = @_; |
my %enrollvar = &get_enrollment_settings($cdom,$cnum); |
my %enrollvar = &get_enrollment_settings($cdom,$cnum); |
Line 239 sub print_settings_display {
|
Line 249 sub print_settings_display {
|
</p><p> |
</p><p> |
<a href="javascript:changePage(document.viewparms,'."'menu'".')">'.$lt{'back'}.'</a> |
<a href="javascript:changePage(document.viewparms,'."'menu'".')">'.$lt{'back'}.'</a> |
<a href="javascript:changePage(document.viewparms,'."'setparms'".')">'.&mt('Modify [_1]-only settings',$dctitle).'</a>'."\n". |
<a href="javascript:changePage(document.viewparms,'."'setparms'".')">'.&mt('Modify [_1]-only settings',$dctitle).'</a>'."\n". |
&hidden_form_elements(). |
&hidden_form_elements(). |
'</form>'); |
'</form>'); |
} |
} |
|
|
Line 788 function verify_quota(formname) {
|
Line 798 function verify_quota(formname) {
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
} |
} |
|
my $starthash; |
|
if ($env{'form.phase'} eq 'ccrole') { |
|
$starthash = { |
|
add_entries => {'onload' => "javascript:document.ccrole.submit();"}, |
|
}; |
|
} |
$r->print(&Apache::loncommon::start_page('View/Modify Course Settings', |
$r->print(&Apache::loncommon::start_page('View/Modify Course Settings', |
$js)); |
$js,$starthash)); |
my $bread_text = "View/Modify Courses"; |
my $bread_text = "View/Modify Courses"; |
if ($cdesc ne '') { |
if ($cdesc ne '') { |
$bread_text = "Course Settings: $cdesc"; |
$bread_text = "Course Settings: $cdesc"; |
Line 861 sub course_settings_descrip {
|
Line 877 sub course_settings_descrip {
|
sub hidden_form_elements { |
sub hidden_form_elements { |
my $hidden_elements = |
my $hidden_elements = |
&Apache::lonhtmlcommon::echo_form_input(['gosearch','coursecode', |
&Apache::lonhtmlcommon::echo_form_input(['gosearch','coursecode', |
'numlocalcc','courseowner', |
'prevphase','numlocalcc','courseowner','login','coursequota','intarg', |
'login','coursequota','intarg', 'locarg','krbarg','krbver']); |
'locarg','krbarg','krbver','counter'])."\n". |
|
'<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />'; |
return $hidden_elements; |
return $hidden_elements; |
} |
} |
|
|
Line 882 sub handler {
|
Line 899 sub handler {
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
|
my $phase = $env{'form.phase'}; |
my $phase = $env{'form.phase'}; |
&Apache::lonhtmlcommon::add_breadcrumb |
if ($phase eq '') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/modifycourse", |
({href=>"/adm/modifycourse", |
text=>"Course search"}); |
text=>"Course search"}); |
if ($phase eq '') { |
|
&print_course_search_page($r,$dom,$domdesc); |
&print_course_search_page($r,$dom,$domdesc); |
} else { |
} else { |
|
my $firstform = $phase; |
|
if ($phase eq 'courselist') { |
|
$firstform = 'filterpicker'; |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'courselist')", |
({href=>"javascript:changePage(document.$firstform,'')", |
|
text=>"Course search"}, |
|
{href=>"javascript:changePage(document.$phase,'courselist')", |
text=>"Choose a course"}); |
text=>"Choose a course"}); |
if ($phase eq 'courselist') { |
if ($phase eq 'courselist') { |
&print_course_selection_page($r,$dom,$domdesc); |
&print_course_selection_page($r,$dom,$domdesc); |
} else { |
} else { |
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:changePage(document.$phase,'menu')", |
|
text=>"Pick action"}); |
|
my ($checked,$cdesc) = &check_course($r,$dom,$domdesc); |
my ($checked,$cdesc) = &check_course($r,$dom,$domdesc); |
my $type = $env{'form.type'}; |
my $type = $env{'form.type'}; |
if ($type eq '') { |
if ($type eq '') { |
Line 904 sub handler {
|
Line 924 sub handler {
|
} |
} |
if ($checked eq 'ok') { |
if ($checked eq 'ok') { |
if ($phase eq 'menu') { |
if ($phase eq 'menu') { |
&print_modification_menu($r,$cdesc); |
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:changePage(document.$phase,'menu')", |
|
text=>"Pick action"}); |
|
&print_modification_menu($r,$cdesc,$domdesc); |
|
} elsif ($phase eq 'ccrole') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:changePage(document.$phase,'ccrole')", |
|
text=>"Enter course"}); |
|
&print_ccrole_selected($r,$cdesc,$domdesc); |
} else { |
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:changePage(document.$phase,'menu')", |
|
text=>"Pick action"}); |
my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'}); |
my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'}); |
if ($phase eq 'setquota') { |
if ($phase eq 'setquota') { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |