--- loncom/interface/loncommon.pm 2010/02/12 17:22:24 1.938 +++ loncom/interface/loncommon.pm 2010/02/25 15:41:14 1.944 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.938 2010/02/12 17:22:24 bisitz Exp $ +# $Id: loncommon.pm,v 1.944 2010/02/25 15:41:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5113,13 +5113,20 @@ table.LC_data_table tr td.LC_leftcol_hea table.LC_data_table tr.LC_empty_row td, table.LC_nested tr.LC_empty_row td { - background-color: #FFFFFF; font-weight: bold; font-style: italic; text-align: center; padding: 8px; } +table.LC_data_table tr.LC_empty_row td { + background-color: $sidebg; +} + +table.LC_nested tr.LC_empty_row td { + background-color: #FFFFFF; +} + table.LC_caption { } @@ -5290,23 +5297,23 @@ table.LC_data_table tr > td.LC_roles_is } table.LC_data_table tr > td.LC_roles_future { - background: #FFFF77; + border-right: 8px solid #FFFF77; } table.LC_data_table tr > td.LC_roles_will { - background: #FFAA77; + border-right: 8px solid #FFAA77; } table.LC_data_table tr > td.LC_roles_expired { - background: #FF7777; + border-right: 8px solid #FF7777; } table.LC_data_table tr > td.LC_roles_will_not { - background: #AAFF77; + border-right: 8px solid #AAFF77; } table.LC_data_table tr > td.LC_roles_selected { - background: #11CC55; + border-right: 8px solid #11CC55; } span.LC_current_location { @@ -5768,13 +5775,18 @@ div.LC_clear_float_footer { } div.LC_grade_show_user { - border-left: 5px solid $sidebg; - margin: 0; +/* border-left: 5px solid $sidebg; */ + border-top: 5px solid #000000; + margin: 50px 0 0 0; padding: 15px 0 5px 10px; } div.LC_grade_show_user_odd_row { - border-left: 5px solid #000000; +/* border-left: 5px solid #000000; */ +} + +div.LC_grade_show_user div.LC_Box { + margin-right: 50px; } div.LC_grade_submissions, @@ -9981,19 +9993,19 @@ sub check_clone { my $clonehome=&Apache::lonnet::homeserver($clonecrsunum,$clonecrsudom); my $clonemsg; my $can_clone = 0; - my $lctype = lc($args->{'type'}); + my $lctype = lc($args->{'crstype'}); if ($lctype ne 'community') { $lctype = 'course'; } if ($clonehome eq 'no_host') { - if ($args->{'type'} eq 'Community') { + if ($args->{'crstype'} eq 'Community') { $clonemsg = &mt('No new community created.').$linefeed.&mt('A new community could not be cloned from the specified original - [_1] - because it is a non-existent community.',$args->{'clonecourse'}.':'.$args->{'clonedomain'}); } else { $clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'}); } } else { my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1}); - if ($args->{'type'} eq 'Community') { + if ($args->{'crstype'} eq 'Community') { if ($clonedesc{'type'} ne 'Community') { $clonemsg = &mt('No new community created.').$linefeed.&mt('A new community could not be cloned from the specified original - [_1] - because it is a course not a community.',$args->{'clonecourse'}.':'.$args->{'clonedomain'}); return ($can_clone, $clonemsg, $cloneid, $clonehome); @@ -10012,7 +10024,7 @@ sub check_clone { $can_clone = 1; } else { my $ccrole = 'cc'; - if ($args->{'type'} eq 'Community') { + if ($args->{'crstype'} eq 'Community') { $ccrole = 'co'; } my %roleshash = @@ -10021,9 +10033,11 @@ sub check_clone { 'userroles',['active'],[$ccrole], [$args->{'clonedomain'}]); if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':'.$ccrole}) || (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/,@cloners))) { - $can_clone = 1; - } else { - if ($args->{'type'} eq 'Community') { + $can_clone = 1; + } elsif (&Apache::lonnet::is_course_owner($args->{'clonedomain'},$args->{'clonecourse'},$args->{'ccuname'},$args->{'ccdomain'})) { + $can_clone = 1; + } else { + if ($args->{'crstype'} eq 'Community') { $clonemsg = &mt('No new community created.').$linefeed.&mt('The new community could not be cloned from the existing community because the new community owner ([_1]) does not have cloning rights in the existing community ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'}); } else { $clonemsg = &mt('No new course created.').$linefeed.&mt('The new course could not be cloned from the existing course because the new course owner ([_1]) does not have cloning rights in the existing course ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'}); @@ -10082,11 +10096,19 @@ sub construct_course { # if anyone ever decides to not show this, and Utils::Course::new # will need to be suitably modified. $outcome .= &mt('New LON-CAPA [_1] ID: [_2]',$crstype,$$courseid).$linefeed; + if ($$courseid =~ /^error:/) { + return (0,$outcome); + } + # # Check if created correctly # ($$crsudom,$$crsunum)= &LONCAPA::split_courseid($$courseid); my $crsuhome=&Apache::lonnet::homeserver($$crsunum,$$crsudom); + if ($crsuhome eq 'no_host') { + $outcome .= &mt('Course creation failed, unrecognized course home server.').$linefeed; + return (0,$outcome); + } $outcome .= &mt('Created on').': '.$crsuhome.$linefeed; #