--- loncom/interface/loncreatecourse.pm 2010/07/08 23:19:19 1.141 +++ loncom/interface/loncreatecourse.pm 2013/07/15 14:32:45 1.148 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.141 2010/07/08 23:19:19 raeburn Exp $ +# $Id: loncreatecourse.pm,v 1.148 2013/07/15 14:32:45 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -93,6 +93,7 @@ sub print_course_creation_page { $crstype = 'Course'; } my $defdom=$env{'request.role.domain'}; + my %domdefaults = &Apache::lonnet::get_domain_defaults($defdom); my %host_servers = &Apache::lonnet::get_servers($defdom,'library'); my $course_home = '' + .'' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title($lt{'chsr'}) @@ -313,7 +316,9 @@ END if ($crstype eq 'Course') { $r->print(&Apache::lonhtmlcommon::row_headline() .'

'.$lt{'iinf'}.'

' - .$lt{'stat'} + .$lt{'stat'}.' ' + .&mt('Default credits can also be specified, if different from the domain defaults (official courses: [_1]; unofficial courses: [_2]).', + $domdefaults{'officialcredits'},$domdefaults{'unofficialcredits'}) .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title($lt{'ccod'}) @@ -331,8 +336,14 @@ END .'
('.$lt{'cscs'}.')' .&Apache::lonhtmlcommon::row_closure() ); + if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'}) { + $r->print(&Apache::lonhtmlcommon::row_title($lt{'ccre'}) + .'' + .'
('.$lt{'cred'}.')' + .&Apache::lonhtmlcommon::row_closure() + ); + } } - # Table: New Course / Clone Course $r->print(&Apache::lonhtmlcommon::row_headline() .'

'.$lt{'crco'}.'

' @@ -405,7 +416,7 @@ END .' ' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_headline() - .$lt{'asov'} + .''.$lt{'asov'}.'' .&Apache::lonhtmlcommon::row_closure(1) .&Apache::lonhtmlcommon::end_pick_box() .'' @@ -537,7 +548,7 @@ END

-' +' ); } elsif ($crstype eq 'Community') { $r->print(' @@ -560,6 +571,8 @@ sub create_course { my $ccdomain=&LONCAPA::clean_domain($env{'form.ccdomain'}); my $crstype = 'Community'; my ($enrollstart,$enrollend,$startaccess,$endaccess); + my %domdefaults = + &Apache::lonnet::get_domain_defaults($env{'request.role.domain'}); if ($env{'form.phase'} eq 'coursetwo') { $crstype='Course'; @@ -635,6 +648,11 @@ sub create_course { firstres => $env{'form.firstres'} }; + if (($crstype eq 'Course') && + ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'})) { + $args->{'defaultcredits'} = $env{'form.defaultcredits'}; + } + # # Verify data # @@ -689,7 +707,7 @@ sub create_course { '

'.&mt('Manage Access Keys').'

'); } # Flush the course logs so reverse user roles immediately updated - &Apache::lonnet::flushcourselogs(); + $r->register_cleanup(\&Apache::lonnet::flushcourselogs); $r->print('

'.&mt('Roles will be active at next login').'.

'); } $r->print('

'. @@ -748,11 +766,11 @@ sub print_intro_page { linktitle => 'Display course and community creation requests submitted by authorized users, held pending approval by a Domain Coordinator.' }, { - linktext => 'Display official course requests', + linktext => 'View pending official course requests', url => '/adm/createcourse?phase=pendingdisplay', permission => $show_all_choices, #help => '', - icon => '', + icon => 'edit-find.png', alttext => '', linktitle => 'Display official course requests submitted by authorized users, held pending validation of instructor status.' },