--- loncom/interface/domainprefs.pm 2010/03/22 17:23:34 1.133
+++ loncom/interface/domainprefs.pm 2010/06/21 06:23:24 1.136
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.133 2010/03/22 17:23:34 raeburn Exp $
+# $Id: domainprefs.pm,v 1.136 2010/06/21 06:23:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -756,7 +756,6 @@ sub print_login {
$checkedon{$item} = ' ';
}
}
- my $loginheader = 'image';
my @images = ('img','logo','domlogo','login');
my @logintext = ('textcol','bgcol');
my @bgs = ('pgbg','mainbg','sidebg');
@@ -805,9 +804,6 @@ sub print_login {
$is_custom{$item} = 1;
}
}
- if ($settings->{'loginheader'} ne '') {
- $loginheader = $settings->{'loginheader'};
- }
if ($settings->{'font'} ne '') {
$designs{'font'} = $settings->{'font'};
$is_custom{'font'} = 1;
@@ -866,7 +862,7 @@ sub print_login {
'';
$itemcount ++;
}
- $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext,$loginheader);
+ $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext);
$datatable .= '';
return $datatable;
}
@@ -986,9 +982,9 @@ sub print_rolecolors {
sub display_color_options {
my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs,
- $images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_;
+ $images,$bgs,$links,$alt_text,$rowtotal,$logintext) = @_;
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
- my $datatable = '
'.
+ my $datatable = '
'.
''.$choices->{'font'}.' | ';
if (!$is_custom->{'font'}) {
$datatable .= ''.&mt('Default in use:').' '.$defaults->{'font'}.' | ';
@@ -1028,8 +1024,7 @@ sub display_color_options {
if ($role eq 'login') {
if ($img eq 'login') {
$login_hdr_pick =
- &login_header_options($img,$role,$defaults,$is_custom,$choices,
- $loginheader);
+ &login_header_options($img,$role,$defaults,$is_custom,$choices);
$logincolors =
&login_text_colors($img,$role,$logintext,$phase,$choices,
$designs);
@@ -1106,8 +1101,8 @@ sub display_color_options {
}
$datatable .= '';
if ($img eq 'login') {
- $datatable .= $login_hdr_pick;
- }
+ $datatable .= $login_hdr_pick;
+ }
$datatable .= &image_changes($is_custom->{$img},$alt_text->{$img},$img_import,
$showfile,$fullsize,$role,$img,$imgfile,$logincolors);
} else {
@@ -1121,7 +1116,9 @@ sub display_color_options {
if ($switchserver) {
$datatable .= &mt('Upload to library server: [_1]',$switchserver);
} else {
- $datatable .=' ';
+ if ($img ne 'login') { # suppress file selection for Log-in header
+ $datatable .=' ';
+ }
}
$datatable .= ' |
';
}
@@ -1210,20 +1207,10 @@ sub logo_display_options {
}
sub login_header_options {
- my ($img,$role,$defaults,$is_custom,$choices,$loginheader) = @_;
- my $image_checked = ' checked="checked" ';
- my $text_checked = ' ';
- if ($loginheader eq 'text') {
- $image_checked = ' ';
- $text_checked = ' checked="checked" ';
- }
- my $output = ' '.
- '
'."\n";
+ my ($img,$role,$defaults,$is_custom,$choices) = @_;
+ my $output = '';
if ((!$is_custom->{'textcol'}) || (!$is_custom->{'bgcol'})) {
- $output .= &mt('Text default(s)').':
';
+ $output .= &mt('Text default(s):').'
';
if (!$is_custom->{'textcol'}) {
$output .= $choices->{'textcol'}.': '.$defaults->{'logintext'}{'textcol'}.
' ';
@@ -1259,25 +1246,31 @@ sub login_text_colors {
sub image_changes {
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_;
my $output;
- if (!$is_custom) {
+ if ($img eq 'login') {
+ # suppress image for Log-in header
+ } elsif (!$is_custom) {
if ($img ne 'domlogo') {
$output .= &mt('Default image:').'
';
} else {
$output .= &mt('Default in use:').'
';
}
}
- if ($img_import) {
- $output .= '';
- }
- $output .= '
';
- if ($is_custom) {
- $output .= ''.$logincolors.' '.&mt('Replace:').' ';
+ if ($img eq 'login') { # suppress image for Log-in header
+ $output .= ' | '.$logincolors;
} else {
- $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ if ($img_import) {
+ $output .= '';
+ }
+ $output .= ' | ';
+ if ($is_custom) {
+ $output .= ''.$logincolors.' '.&mt('Replace:').' ';
+ } else {
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ }
}
return $output;
}
@@ -2014,12 +2007,13 @@ sub print_contacts {
my ($dom,$settings,$rowtotal) = @_;
my $datatable;
my @contacts = ('adminemail','supportemail');
- my (%checked,%to,%otheremails);
+ my (%checked,%to,%otheremails,%bccemails);
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail',
'requestsmail');
foreach my $type (@mailings) {
$otheremails{$type} = '';
}
+ $bccemails{'helpdeskmail'} = '';
if (ref($settings) eq 'HASH') {
foreach my $item (@contacts) {
if (exists($settings->{$item})) {
@@ -2035,6 +2029,9 @@ sub print_contacts {
}
}
$otheremails{$type} = $settings->{$type}{'others'};
+ if ($type eq 'helpdeskmail') {
+ $bccemails{$type} = $settings->{$type}{'bcc'};
+ }
}
} elsif ($type eq 'lonstatusmail') {
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
@@ -2078,8 +2075,13 @@ sub print_contacts {
}
$datatable .= ' '.&mt('Others').': '.
''.
- ' | '."\n";
+ 'value="'.$otheremails{$type}.'" />';
+ if ($type eq 'helpdeskmail') {
+ $datatable .= '
'.&mt('Bcc:').(' 'x6).
+ '';
+ }
+ $datatable .= ''."\n";
}
$$rowtotal += $rownum;
return $datatable;
@@ -3699,22 +3701,12 @@ sub modify_login {
}
}
}
- if (($domconfig{'login'}{'loginheader'} eq 'text') &&
- ($env{'form.loginheader'} eq 'image')) {
- $changes{'loginheader'} = 1;
- } elsif (($domconfig{'login'}{'loginheader'} eq '' ||
- $domconfig{'login'}{'loginheader'} eq 'image') &&
- ($env{'form.loginheader'} eq 'text')) {
- $changes{'loginheader'} = 1;
- }
}
if (keys(%changes) > 0 || $colchgtext) {
&Apache::loncommon::devalidate_domconfig_cache($dom);
$resulttext = &mt('Changes made:').'';
foreach my $item (sort(keys(%changes))) {
- if ($item eq 'loginheader') {
- $resulttext .= '- '.&mt("$title{$item} set to $env{'form.loginheader'}").'
';
- } elsif ($item eq 'loginvia') {
+ if ($item eq 'loginvia') {
if (ref($changes{$item}) eq 'HASH') {
$resulttext .= '- '.&mt('Log-in page availability:').'
';
foreach my $lonhost (sort(keys(%{$changes{$item}}))) {
@@ -5186,7 +5178,7 @@ sub modify_contacts {
$currsetting{$key} = $domconfig{'contacts'}{$key};
}
}
- my (%others,%to);
+ my (%others,%to,%bcc);
my @contacts = ('supportemail','adminemail');
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail',
'requestsmail');
@@ -5202,6 +5194,10 @@ sub modify_contacts {
}
$others{$type} = $env{'form.'.$type.'_others'};
$contacts_hash{contacts}{$type}{'others'} = $others{$type};
+ if ($type eq 'helpdeskmail') {
+ $bcc{$type} = $env{'form.'.$type.'_bcc'};
+ $contacts_hash{contacts}{$type}{'bcc'} = $bcc{$type};
+ }
}
foreach my $item (@contacts) {
$to{$item} = $env{'form.'.$item};
@@ -5226,6 +5222,11 @@ sub modify_contacts {
if ($others{$type} ne $currsetting{$type}{'others'}) {
push(@{$changes{$type}},'others');
}
+ if ($type eq 'helpdeskmail') {
+ if ($bcc{$type} ne $currsetting{$type}{'bcc'}) {
+ push(@{$changes{$type}},'bcc');
+ }
+ }
}
} else {
my %default;
@@ -5248,7 +5249,12 @@ sub modify_contacts {
}
if ($others{$type} ne '') {
push(@{$changes{$type}},'others');
- }
+ }
+ if ($type eq 'helpdeskmail') {
+ if ($bcc{$type} ne '') {
+ push(@{$changes{$type}},'bcc');
+ }
+ }
}
}
my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash,
@@ -5276,7 +5282,13 @@ sub modify_contacts {
push(@text,$others{$type});
}
$resulttext .= ''.
- join(', ',@text).'
';
+ join(', ',@text).'';
+ if ($type eq 'helpdeskmail') {
+ if ($bcc{$type} ne '') {
+ $resulttext .= ' '.&mt('with Bcc to').': '.$bcc{$type}.'';
+ }
+ }
+ $resulttext .= '';
}
}
$resulttext .= '
';