--- loncom/interface/loncommon.pm 2009/08/14 08:07:11 1.692.4.9 +++ loncom/interface/loncommon.pm 2009/10/10 03:40:24 1.692.4.18 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.692.4.9 2009/08/14 08:07:11 raeburn Exp $ +# $Id: loncommon.pm,v 1.692.4.18 2009/10/10 03:40:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -482,7 +482,7 @@ ENDAUTHORBRW sub coursebrowser_javascript { my ($domainfilter,$sec_element,$formname)=@_; - my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role'); + my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role.'); my $id_functions = &javascript_index_functions(); my $output = ' ENDTEMPLATE return $template; @@ -2971,7 +2979,7 @@ sub syllabuswrapper { } sub track_student_link { - my ($linktext,$sname,$sdom,$target,$start) = @_; + my ($linktext,$sname,$sdom,$target,$start,$only_body) = @_; my $link ="/adm/trackstudent?"; my $title = 'View recent activity'; if (defined($sname) && $sname !~ /^\s*$/ && @@ -2985,6 +2993,7 @@ sub track_student_link { $target = ''; } if ($start) { $link.='&start='.$start; } + if ($only_body) { $link .= '&only_body=1'; } $title = &mt($title); $linktext = &mt($linktext); return qq{$linktext}. @@ -4089,7 +4098,7 @@ sub determinedomain { my $domain=shift; if (! $domain) { # Determine domain if we have not been given one - $domain = $Apache::lonnet::perlvar{'lonDefDomain'}; + $domain = &Apache::lonnet::default_login_domain(); if ($env{'user.domain'}) { $domain=$env{'user.domain'}; } if ($env{'request.role.domain'}) { $domain=$env{'request.role.domain'}; @@ -4634,7 +4643,7 @@ sub standard_css { my $sans = 'Verdana,Arial,Helvetica,sans-serif'; my $mono = 'monospace'; - my $data_table_head = $sidebg; + my $data_table_head = $tabbg; my $data_table_light = '#FAFAFA'; my $data_table_dark = '#F0F0F0'; my $data_table_darker = '#CCCCCC'; @@ -4921,6 +4930,7 @@ table.LC_nested_outer { border-spacing: 0; width: 100%; } +table.LC_innerpickbox, table.LC_nested { border: none; border-collapse: collapse; @@ -4928,11 +4938,16 @@ table.LC_nested { width: 100%; } table.LC_data_table tr th, table.LC_calendar tr th, table.LC_mail_list tr th, -table.LC_prior_tries tr th { +table.LC_prior_tries tr th, +table.LC_innerpickbox tr th { font-weight: bold; background-color: $data_table_head; font-size: smaller; } +table.LC_innerpickbox tr th, +table.LC_innerpickbox tr td { + vertical-align: top; +} table.LC_data_table tr.LC_info_row > td { background-color: #CCCCCC; font-weight: bold; @@ -5246,7 +5261,7 @@ table.LC_pick_box { border-spacing: 1px; } table.LC_pick_box td.LC_pick_box_title { - background: $sidebg; + background: $tabbg; font-weight: bold; text-align: right; vertical-align: top; @@ -5254,7 +5269,7 @@ table.LC_pick_box td.LC_pick_box_title { padding: 8px; } table.LC_pick_box td.LC_selfenroll_pick_box_title { - background: $sidebg; + background: $tabbg; font-weight: bold; text-align: right; width: 350px; @@ -6808,6 +6823,8 @@ If the user's status includes multiple t the largest default quota which applies to the user determines the default quota returned. +=back + =cut ############################################### @@ -6956,6 +6973,7 @@ sub user_picker { # loncreateuser::print_user_query_page() # has been completed. next if ($option eq 'alc'); + next if (($option eq 'crs') && ($env{'form.form'} eq 'requestcrs')); next if ($option eq 'crs' && !$env{'request.course.id'}); if ($curr_selected{'srchin'} eq $option) { $srchinsel .= ' @@ -7406,8 +7424,6 @@ sub sorted_slots { =pod -=back - =head1 HTTP Helpers =over 4 @@ -8703,10 +8719,11 @@ sub restore_settings { =item * &build_recipient_list() -Build recipient lists for four types of e-mail: +Build recipient lists for five types of e-mail: (a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors -(d) Help requests, generated by -lonerrorhandler.pm, CHECKRPMS, loncron, and lonsupportreq.pm respectively. +(d) Help requests, (e) Course requests needing approval, generated by +lonerrorhandler.pm, CHECKRPMS, loncron, lonsupportreq.pm and +loncoursequeueadmin.pm respectively. Inputs: defmail (scalar - email address of default recipient), @@ -9279,8 +9296,9 @@ sub check_clone { $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 ($env{'request.role.domain'} eq $args->{'clonedomain'}) { - $can_clone = 1; + if (($env{'request.role.domain'} eq $args->{'clonedomain'}) && + (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'}))) { + $can_clone = 1; } else { my %clonehash = &Apache::lonnet::get('environment',['cloners'], $args->{'clonedomain'},$args->{'clonecourse'}); @@ -9307,7 +9325,7 @@ sub check_clone { } sub construct_course { - my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context) = @_; + my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context,$cnum,$category) = @_; my $outcome; my $linefeed = '
'."\n"; if ($context eq 'auto') { @@ -9345,7 +9363,9 @@ sub construct_course { $args->{'crscode'}, $args->{'ccuname'}.':'. $args->{'ccdomain'}, - $args->{'crstype'}); + $args->{'crstype'}, + $cnum,$context,$category); + # Note: The testing routines depend on this being output; see # Utils::Course. This needs to at least be output as a comment