--- loncom/interface/loncommon.pm 2009/08/14 08:07:11 1.692.4.9
+++ loncom/interface/loncommon.pm 2010/01/19 06:01:09 1.692.4.21
@@ -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.21 2010/01/19 06:01:09 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -481,8 +481,8 @@ 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 ($domainfilter,$sec_element,$formname,$role_element)=@_;
+ 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 +3038,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 +3052,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 +4157,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 +4702,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';
@@ -4727,6 +4795,38 @@ div.LC_confirm_box .LC_success img {
color: #999999;
}
+.LC_discussion {
+ background: $tabbg;
+ border: 1px solid black;
+ margin: 2px;
+}
+
+.LC_disc_action_links_bar {
+ background: $tabbg;
+ border: none;
+ margin: 4px;
+}
+
+.LC_disc_action_left {
+ text-align: left;
+}
+
+.LC_disc_action_right {
+ text-align: right;
+}
+
+.LC_disc_new_item {
+ background: white;
+ border: 2px solid red;
+ margin: 2px;
+}
+
+.LC_disc_old_item {
+ background: white;
+ border: 1px solid black;
+ margin: 2px;
+}
+
table.LC_pastsubmission {
border: 1px solid black;
margin: 2px;
@@ -4921,6 +5021,7 @@ table.LC_nested_outer {
border-spacing: 0;
width: 100%;
}
+table.LC_innerpickbox,
table.LC_nested {
border: none;
border-collapse: collapse;
@@ -4928,11 +5029,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 +5352,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 +5360,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 +6914,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 +7064,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 +7515,6 @@ sub sorted_slots {
=pod
-=back
-
=head1 HTTP Helpers
=over 4
@@ -8703,10 +8810,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 +9387,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 +9416,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 +9454,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
@@ -9659,6 +9770,16 @@ sub group_term {
return $names{$crstype};
}
+sub course_types {
+ my @types = ('official','unofficial','community');
+ my %typename = (
+ official => 'Official course',
+ unofficial => 'Unofficial course',
+ community => 'Community',
+ );
+ return (\@types,\%typename);
+}
+
sub icon {
my ($file)=@_;
my $curfext = lc((split(/\./,$file))[-1]);