--- loncom/interface/courseprefs.pm 2010/04/02 21:39:12 1.27 +++ loncom/interface/courseprefs.pm 2010/12/22 16:57:41 1.28.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.27 2010/04/02 21:39:12 raeburn Exp $ +# $Id: courseprefs.pm,v 1.28.2.5 2010/12/22 16:57:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -320,6 +320,7 @@ sub handler { seme => 'Send message to student when clicking Done on Tasks', ); } + $lt{'lcrv'} = 'Required LON-CAPA version'; &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/courseprefs', text=>$lt{'conf'}}); my $breadcrumbs = @@ -344,9 +345,11 @@ sub handler { 'courseinfo' => { text => $lt{'gens'}, help => 'Course_Environment', - ordered => ['owner','co-owners','description','courseid', - 'categories','hidefromcat','externalsyllabus', - 'cloners','url','rolenames'], + header => [{col1 => 'Setting', + col2 => 'Value'}], + ordered => ['owner','co-owners','loncaparev','description', + 'courseid','categories','hidefromcat', + 'externalsyllabus','cloners','url','rolenames'], itemtext => { 'owner' => $lt{'ownr'}, 'co-owners' => $lt{'cown'}, @@ -358,11 +361,14 @@ sub handler { 'externalsyllabus' => 'URL of Syllabus', 'url' => 'Top Level Map', 'rolenames' => $lt{'rept'}, + 'loncaparev' => $lt{'lcrv'}, }, }, 'localization' => { text => 'Language and Time Localization', help => 'Course_Environment', + header => [{col1 => 'Setting', + col2 => 'Value',}], ordered => ['languages','timezone','datelocale'], itemtext => { languages => 'Languages used', @@ -374,7 +380,9 @@ sub handler { { text => 'Feedback messages', help => 'Course_Environment', header => [{col1 => 'Questions about:', - col2 => 'Recipients'}], + col2 => 'Recipients'}, + {col1 => 'Questions about:', + col2 => 'Custom Text'}], ordered => ['question.email','comment.email','policy.email'], itemtext => { 'question.email' => 'Resource Content', @@ -385,15 +393,15 @@ sub handler { 'discussion' => { text => 'Discussion and Chat', help => 'Course_Environment', - ordered => ['plc.roles.denied','plc.users.denied', - 'pch.roles.denied','pch.users.denied', + ordered => ['pch.roles.denied','pch.users.denied', + 'plc.roles.denied','plc.users.denied', 'allow_limited_html_in_feedback', 'allow_discussion_post_editing'], itemtext => { - 'plc.roles.denied' => 'No Resource Discussion', - 'plc.users.denied' => 'No Resource Discussion', - 'pch.roles.denied' => 'No Chat room use', - 'pch.users.denied' => 'No Chat room use', + 'pch.roles.denied' => 'No Resource Discussion', + 'pch.users.denied' => 'No Resource Discussion', + 'plc.roles.denied' => 'No Chat room use', + 'plc.users.denied' => 'No Chat room use', allow_limited_html_in_feedback => 'Allow limited HTML in discussion', allow_discussion_post_editing => 'Users can edit/delete own discussion posts', }, @@ -423,6 +431,8 @@ sub handler { 'appearance' => { text => 'Display of resources ', help => 'Course_Environment', + header => [{col1 => 'Setting', + col2 => 'Value',}], ordered => ['default_xml_style','pageseparators', 'disable_receipt_display','texengine', 'tthoptions'], @@ -437,6 +447,8 @@ sub handler { 'grading' => { text => 'Grading', help => 'Course_Environment', + header => [{col1 => 'Setting', + col2 => 'Value',}], ordered => ['grading','rndseed', 'receiptalg','disablesigfigs'], itemtext => { @@ -450,6 +462,8 @@ sub handler { 'printouts' => { text => 'Printout generation', help => 'Course_Environment', + header => [{col1 => 'Setting', + col2 => 'Value',}], ordered => ['problem_stream_switch','suppress_tries', 'default_paper_size','print_header_format', 'disableexampointprint','canuse_pdfforms'], @@ -465,6 +479,8 @@ sub handler { 'spreadsheet' => { text => 'Spreadsheets', help => 'Course_Environment', + header => [{col1 => 'Setting', + col2 => 'Value'}], ordered => ['spreadsheet_default_classcalc', 'spreadsheet_default_studentcalc', 'spreadsheet_default_assesscalc','hideemptyrows'], @@ -478,6 +494,8 @@ sub handler { 'bridgetasks' => { text => 'Bridge tasks', help => 'Course_Environment', + header => [{col1 => 'Setting', + col2 => 'Value'}], ordered => ['task_messages','task_grading', 'suppress_embed_prompt'], itemtext => { @@ -533,12 +551,17 @@ sub print_config_box { my $itemtext = $item->{'itemtext'}; my $rowtotal = 0; my $output = - '

'.&mt($item->{text}).'

-
 '. - &Apache::loncommon::help_open_topic($item->{'help'}).''; + ' + + '."\n". + ''; if (($action eq 'feedback') || ($action eq 'classlists')) { $output .= ' -
'. + &mt($item->{text}).' '. + &Apache::loncommon::help_open_topic($item->{'help'}).'
'; + + + + + + + + '; } } - $output .= ''; if ($showsections) { @@ -2588,7 +2624,7 @@ sub role_checkboxes { $output .= ''; } } - $output .= ''; if ($showsections) { @@ -3301,7 +3337,7 @@ sub substitution_selector { a => 'assignment note', ); my $output .= &mt('Substitution').'
'. - ''; if ($subst eq '') { $output .= ''; }
+ '; if (exists $item->{'header'}->[0]->{'col1'} || exists $item->{'header'}->[0]->{'col2'}) { $output .= ' @@ -555,6 +578,10 @@ sub print_config_box { } $output .= '
+
'; @@ -565,6 +592,10 @@ sub print_config_box { $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). '
'.&mt($item->{'header'}->[1]->{'col1'}).'
+
'; if (exists $item->{'header'}->[0]->{'col1'} || exists $item->{'header'}->[0]->{'col2'}) { @@ -573,10 +604,12 @@ sub print_config_box { '; - } + } } } else { $output .= ' + + + +
'.&mt($item->{'header'}->[0]->{'col1'}).' '.&mt($item->{'header'}->[0]->{'col2'}).'
'; if (exists $item->{'header'}->[0]->{'col1'} || exists $item->{'header'}->[0]->{'col2'}) { @@ -613,7 +646,9 @@ sub print_config_box { } $output .= '
-'; +

'; return ($output,$rowtotal); } @@ -679,6 +714,7 @@ sub process_changes { } } else { foreach my $entry (@ordered) { + next if (($entry eq 'loncaparev') || ($entry eq 'owner')); if ($entry eq 'cloners') { if ($env{'form.cloners_all'}) { $newvalues{$entry} = '*'; @@ -687,8 +723,8 @@ sub process_changes { if (exists($env{'form.cloners_activate'})) { my $actnum = $env{'form.cloners_activate'}; if ($actnum ne '') { - if ($env{'form.clonersdom_'.$actnum} ne '') { - my $clonedom = $env{'form.clonersdom_'.$actnum}; + if ($env{'form.cloners_dom_'.$actnum} ne '') { + my $clonedom = $env{'form.cloners_dom_'.$actnum}; if (&check_clone($clonedom,$disallowed) eq 'ok') { $newvalues{$entry} = '*:'.$clonedom; push(@clonedoms,$newvalues{$entry}); @@ -1000,8 +1036,8 @@ sub process_changes { $hdr .= $env{'form.printfmthdr_limit_'.$i}; } $hdr .= $env{'form.printfmthdr_sub_'.$i}; - } elsif ($env{'form.printfmthdr_sub_'.$i} ne '') { - $hdr = $env{'form.printfmthdr_sub_'.$i}; + } elsif ($env{'form.printfmthdr_text_'.$i} ne '') { + $hdr = $env{'form.printfmthdr_text_'.$i}; } $newhdr[$env{'form.printfmthdr_pos_'.$i}] = $hdr; } @@ -1296,7 +1332,7 @@ sub store_changes { if ($key eq 'url') { my $bkuptime=time; $output .= (' 'x2).&mt('(Previous URL backed up)').': '. - $storehash{'top level map backup '.$bkuptime} => $values->{$key}; + $storehash{'top level map backup '.$bkuptime} = $values->{$key}; } $output .= ''; } @@ -1659,7 +1695,6 @@ sub print_courseinfo { '', input => 'textbox', size => '40', - advanced => 1 }, 'description' => { text => ''.&mt($itemtext->{'description'}).'', @@ -1683,14 +1718,12 @@ sub print_courseinfo { &mt('Owner and Coordinators included automatically'), input => 'textbox', size => '40', - advanced => 1 }, 'rolenames' => { text => ''.&mt($itemtext->{'rolenames'}).'
'. '('.$replace.')', input => 'textbox', size => '20', - advanced => 1 }, 'externalsyllabus' => { text => ''.&mt($itemtext->{'externalsyllabus'}).'
('. @@ -1709,6 +1742,9 @@ sub print_courseinfo { input => 'textbox', size => '25', }, + 'loncaparev' => { + text => ''.&mt($itemtext->{'loncaparev'}).'', + }, ); my $datatable; my $count = 0; @@ -1719,11 +1755,7 @@ sub print_courseinfo { next if (!$can_categorize); } $count ++; - if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { - $datatable .= &item_table_row_start($items{$item}{text},$count,"advanced"); - } else { - $datatable .= &item_table_row_start($items{$item}{text},$count); - } + $datatable .= &item_table_row_start($items{$item}{text},$count); if ($items{$item}{input} eq 'radio') { $datatable .= &yesno_radio($item,$settings); } elsif ($item eq 'cloners') { @@ -1846,7 +1878,6 @@ sub print_courseinfo { } else { $owner = &mt('None specified'); } - my $domdesc = &Apache::lonnet::domain($cdom,'description'); $datatable .= $owner; } elsif ($item eq 'co-owners') { my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; @@ -1868,6 +1899,15 @@ sub print_courseinfo { $datatable .= &manage_coownership($cnum,$cdom,@currcoown); } } + } elsif ($item eq 'loncaparev') { + my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; + my $showreqd; + if ($loncaparev) { + $showreqd = &mt('[_1] or newer',$loncaparev); + } else { + $showreqd = &mt('No specific version required'); + } + $datatable .= $showreqd; } else { $datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size}); } @@ -2281,18 +2321,14 @@ sub print_feedback { foreach my $item (@{$ordered}) { $count ++; - if ($position eq 'top') { - $datatable .= &item_table_row_start($items{$item}{text},$count); - } else { - $datatable .= &item_table_row_start($items{$item}{text}."
(Custom text)",$count, "advanced"); - } + $datatable .= &item_table_row_start($items{$item}{text},$count); if ($position eq 'top') { my $includeempty = 0; $datatable .= &user_table($cdom,$item,\@sections, $settings->{$item},\%lt); } else { $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', - $settings->{$item.'.text'},$items{$item}{size}); + $settings->{$item.'.text'},$items{$item}{size}); } $datatable .= &item_table_row_end(); } @@ -2556,7 +2592,7 @@ sub role_checkboxes { $output .= '