version 1.202, 2013/08/08 00:53:32
|
version 1.203, 2013/08/12 16:51:57
|
Line 526 sub process_changes {
|
Line 526 sub process_changes {
|
} elsif ($action eq 'contacts') { |
} elsif ($action eq 'contacts') { |
$output = &modify_contacts($dom,%domconfig); |
$output = &modify_contacts($dom,%domconfig); |
} elsif ($action eq 'defaults') { |
} elsif ($action eq 'defaults') { |
$output = &modify_defaults($dom,$r); |
$output = &modify_defaults($dom,$r,%domconfig); |
} elsif ($action eq 'scantron') { |
} elsif ($action eq 'scantron') { |
$output = &modify_scantron($r,$dom,$confname,%domconfig); |
$output = &modify_scantron($r,$dom,$confname,%domconfig); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
Line 2309 sub print_contacts {
|
Line 2309 sub print_contacts {
|
my @contacts = ('adminemail','supportemail'); |
my @contacts = ('adminemail','supportemail'); |
my (%checked,%to,%otheremails,%bccemails); |
my (%checked,%to,%otheremails,%bccemails); |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
'requestsmail','updatesmail'); |
'requestsmail','updatesmail','idconflictsmail'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$otheremails{$type} = ''; |
$otheremails{$type} = ''; |
} |
} |
Line 2346 sub print_contacts {
|
Line 2346 sub print_contacts {
|
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'updatesmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'updatesmail'}{'adminemail'} = ' checked="checked" '; |
|
$checked{'idconflictsmail'}{'adminemail'} = ' checked="checked" '; |
} |
} |
my ($titles,$short_titles) = &contact_titles(); |
my ($titles,$short_titles) = &contact_titles(); |
my $rownum = 0; |
my $rownum = 0; |
my $css_class; |
my $css_class; |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
$rownum ++; |
|
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td><span class="LC_nobreak">'.$titles->{$item}. |
'<td><span class="LC_nobreak">'.$titles->{$item}. |
'</span></td><td class="LC_right_item">'. |
'</span></td><td class="LC_right_item">'. |
'<input type="text" name="'.$item.'" value="'. |
'<input type="text" name="'.$item.'" value="'. |
$to{$item}.'" /></td></tr>'; |
$to{$item}.'" /></td></tr>'; |
|
$rownum ++; |
} |
} |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$rownum ++; |
|
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$css_class = $rownum%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'>'. |
$datatable .= '<tr'.$css_class.'>'. |
'<td><span class="LC_nobreak">'. |
'<td><span class="LC_nobreak">'. |
Line 2383 sub print_contacts {
|
Line 2383 sub print_contacts {
|
'value="'.$bccemails{$type}.'" />'; |
'value="'.$bccemails{$type}.'" />'; |
} |
} |
$datatable .= '</td></tr>'."\n"; |
$datatable .= '</td></tr>'."\n"; |
|
$rownum ++; |
} |
} |
|
my %choices; |
|
$choices{'reporterrors'} = &mt('E-mail error reports to [_1]', |
|
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
|
&mt('LON-CAPA core group - MSU'),600,500)); |
|
$choices{'reportupdates'} = &mt('E-mail record of completed LON-CAPA updates to [_1]', |
|
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
|
&mt('LON-CAPA core group - MSU'),600,500)); |
|
my @toggles = ('reporterrors','reportupdates'); |
|
my %defaultchecked = ('reporterrors' => 'on', |
|
'reportupdates' => 'on'); |
|
(my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
|
\%choices,$rownum); |
|
$datatable .= $reports; |
$$rowtotal += $rownum; |
$$rowtotal += $rownum; |
return $datatable; |
return $datatable; |
} |
} |
Line 3301 sub contact_titles {
|
Line 3315 sub contact_titles {
|
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)', |
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)', |
'requestsmail' => 'E-mail from course requests requiring approval', |
'requestsmail' => 'E-mail from course requests requiring approval', |
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates', |
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates', |
|
'idconflictsmail' => 'E-mail from bi-nightly check for multiple users sharing same student/employee ID', |
); |
); |
my %short_titles = &Apache::lonlocal::texthash ( |
my %short_titles = &Apache::lonlocal::texthash ( |
adminemail => 'Admin E-mail address', |
adminemail => 'Admin E-mail address', |
Line 6672 sub modify_contacts {
|
Line 6687 sub modify_contacts {
|
my (%others,%to,%bcc); |
my (%others,%to,%bcc); |
my @contacts = ('supportemail','adminemail'); |
my @contacts = ('supportemail','adminemail'); |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
'requestsmail','updatesmail'); |
'requestsmail','updatesmail','idconflictsmail'); |
|
my @toggles = ('reporterrors','reportupdates'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
@{$newsetting{$type}} = |
@{$newsetting{$type}} = |
&Apache::loncommon::get_env_multiple('form.'.$type); |
&Apache::loncommon::get_env_multiple('form.'.$type); |
Line 6694 sub modify_contacts {
|
Line 6710 sub modify_contacts {
|
$to{$item} = $env{'form.'.$item}; |
$to{$item} = $env{'form.'.$item}; |
$contacts_hash{'contacts'}{$item} = $to{$item}; |
$contacts_hash{'contacts'}{$item} = $to{$item}; |
} |
} |
|
foreach my $item (@toggles) { |
|
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
|
$contacts_hash{'contacts'}{$item} = $env{'form.'.$item}; |
|
} |
|
} |
if (keys(%currsetting) > 0) { |
if (keys(%currsetting) > 0) { |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
if ($to{$item} ne $currsetting{$item}) { |
if ($to{$item} ne $currsetting{$item}) { |
Line 6732 sub modify_contacts {
|
Line 6753 sub modify_contacts {
|
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
if ($to{$item} ne $default{$item}) { |
if ($to{$item} ne $default{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} |
} |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
if ((@{$newsetting{$type}} != 1) || ($newsetting{$type}[0] ne $default{$type})) { |
if ((@{$newsetting{$type}} != 1) || ($newsetting{$type}[0] ne $default{$type})) { |
Line 6749 sub modify_contacts {
|
Line 6770 sub modify_contacts {
|
} |
} |
} |
} |
} |
} |
|
foreach my $item (@toggles) { |
|
if (($env{'form.'.$item} == 1) && ($currsetting{$item} == 0)) { |
|
$changes{$item} = 1; |
|
} elsif ((!$env{'form.'.$item}) && |
|
(($currsetting{$item} eq '') || ($currsetting{$item} == 1))) { |
|
$changes{$item} = 1; |
|
} |
|
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash, |
$dom); |
$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
Line 6783 sub modify_contacts {
|
Line 6812 sub modify_contacts {
|
$resulttext .= '</li>'; |
$resulttext .= '</li>'; |
} |
} |
} |
} |
|
my @offon = ('off','on'); |
|
if ($changes{'reporterrors'}) { |
|
$resulttext .= '<li>'. |
|
&mt('E-mail error reports to [_1] set to "'. |
|
$offon[$env{'form.reporterrors'}].'".', |
|
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
|
&mt('LON-CAPA core group - MSU'),600,500)). |
|
'</li>'; |
|
} |
|
if ($changes{'reportupdates'}) { |
|
$resulttext .= '<li>'. |
|
&mt('E-mail record of completed LON-CAPA updates to [_1] set to "'. |
|
$offon[$env{'form.reportupdates'}].'".', |
|
&Apache::loncommon::modal_link('http://loncapa.org/core.html', |
|
&mt('LON-CAPA core group - MSU'),600,500)). |
|
'</li>'; |
|
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('No changes made to contact information'); |
$resulttext = &mt('No changes made to contact information'); |
Line 7377 sub modify_usermodification {
|
Line 7423 sub modify_usermodification {
|
} |
} |
|
|
sub modify_defaults { |
sub modify_defaults { |
my ($dom,$r) = @_; |
my ($dom,$r,%domconfig) = @_; |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def'); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def'); |
Line 7463 sub modify_defaults {
|
Line 7509 sub modify_defaults {
|
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'} || $changes{'datelocale_def'}) { |
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'} || $changes{'datelocale_def'}) { |
my $sysmail = $r->dir_config('lonSysEMail'); |
my $notify = 1; |
&Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext); |
if (ref($domconfig{'contacts'}) eq 'HASH') { |
|
if ($domconfig{'contacts'}{'reportupdates'} == 0) { |
|
$notify = 0; |
|
} |
|
} |
|
if ($notify) { |
|
&Apache::lonmsg::sendemail('installrecord@loncapa.org', |
|
"LON-CAPA Domain Settings Change - $dom", |
|
$mailmsgtext); |
|
} |
} |
} |
} else { |
} else { |
$resulttext = &mt('No changes made to default authentication/language/timezone settings'); |
$resulttext = &mt('No changes made to default authentication/language/timezone settings'); |