version 1.128, 2010/03/03 16:43:41
|
version 1.129, 2010/03/08 14:36:24
|
Line 1692 sub print_courserequestmail {
|
Line 1692 sub print_courserequestmail {
|
sub print_autoenroll { |
sub print_autoenroll { |
my ($dom,$settings,$rowtotal) = @_; |
my ($dom,$settings,$rowtotal) = @_; |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my ($defdom,$runon,$runoff); |
my ($defdom,$runon,$runoff,$coownerson,$coownersoff); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (exists($settings->{'run'})) { |
if (exists($settings->{'run'})) { |
if ($settings->{'run'} eq '0') { |
if ($settings->{'run'} eq '0') { |
Line 1711 sub print_autoenroll {
|
Line 1711 sub print_autoenroll {
|
$runon = ' '; |
$runon = ' '; |
} |
} |
} |
} |
|
if (exists($settings->{'co-owners'})) { |
|
if ($settings->{'co-owners'} eq '0') { |
|
$coownersoff = ' checked="checked" '; |
|
$coownerson = ' '; |
|
} else { |
|
$coownerson = ' checked="checked" '; |
|
$coownersoff = ' '; |
|
} |
|
} else { |
|
$coownersoff = ' checked="checked" '; |
|
$coownerson = ' '; |
|
} |
if (exists($settings->{'sender_domain'})) { |
if (exists($settings->{'sender_domain'})) { |
$defdom = $settings->{'sender_domain'}; |
$defdom = $settings->{'sender_domain'}; |
} |
} |
Line 1741 sub print_autoenroll {
|
Line 1753 sub print_autoenroll {
|
&mt('username').': '. |
&mt('username').': '. |
'<input type="text" name="sender_uname" value="'. |
'<input type="text" name="sender_uname" value="'. |
$notif_sender.'" size="10" /> '.&mt('domain'). |
$notif_sender.'" size="10" /> '.&mt('domain'). |
': '.$domform.'</span></td></tr>'; |
': '.$domform.'</span></td></tr>'. |
$$rowtotal += 2; |
'<tr class="LC_odd_row">'. |
|
'<td>'.&mt('Automatically assign co-ownership').'</td>'. |
|
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="autoassign_coowners"'. |
|
$coownerson.' value="1" />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="autoassign_coowners"'. |
|
$coownersoff.' value="0" />'.&mt('No').'</label></span></td>'. |
|
'</tr>'; |
|
$$rowtotal += 3; |
return $datatable; |
return $datatable; |
} |
} |
|
|
Line 4635 sub modify_autoenroll {
|
Line 4655 sub modify_autoenroll {
|
} |
} |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my %title = ( run => 'Auto-enrollment active', |
my %title = ( run => 'Auto-enrollment active', |
sender => 'Sender for notification messages'); |
sender => 'Sender for notification messages', |
|
coowners => 'Automatic assignment of co-ownership to instructors of record (institutional data)'); |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
my $sender_uname = $env{'form.sender_uname'}; |
my $sender_uname = $env{'form.sender_uname'}; |
my $sender_domain = $env{'form.sender_domain'}; |
my $sender_domain = $env{'form.sender_domain'}; |
Line 4644 sub modify_autoenroll {
|
Line 4665 sub modify_autoenroll {
|
} elsif ($sender_uname eq '') { |
} elsif ($sender_uname eq '') { |
$sender_domain = ''; |
$sender_domain = ''; |
} |
} |
|
my $coowners = $env{'form.autoassign_coowners'}; |
my %autoenrollhash = ( |
my %autoenrollhash = ( |
autoenroll => { run => $env{'form.autoenroll_run'}, |
autoenroll => { 'run' => $env{'form.autoenroll_run'}, |
sender_uname => $sender_uname, |
'sender_uname' => $sender_uname, |
sender_domain => $sender_domain, |
'sender_domain' => $sender_domain, |
|
'co-owners' => $coowners, |
} |
} |
); |
); |
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash, |
Line 4669 sub modify_autoenroll {
|
Line 4691 sub modify_autoenroll {
|
if ($currautoenroll{'sender_domain'} ne $sender_domain) { |
if ($currautoenroll{'sender_domain'} ne $sender_domain) { |
$changes{'sender'} = 1; |
$changes{'sender'} = 1; |
} |
} |
|
if ($currautoenroll{'co-owners'} ne '') { |
|
if ($currautoenroll{'co-owners'} ne $coowners) { |
|
$changes{'coowners'} = 1; |
|
} |
|
} elsif ($coowners) { |
|
$changes{'coowners'} = 1; |
|
} |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
if ($changes{'run'}) { |
if ($changes{'run'}) { |
Line 4681 sub modify_autoenroll {
|
Line 4710 sub modify_autoenroll {
|
$resulttext .= '<li>'.&mt("$title{'sender'} set to [_1]",$sender_uname.':'.$sender_domain).'</li>'; |
$resulttext .= '<li>'.&mt("$title{'sender'} set to [_1]",$sender_uname.':'.$sender_domain).'</li>'; |
} |
} |
} |
} |
|
if ($changes{'coowners'}) { |
|
$resulttext .= '<li>'.&mt("$title{'coowners'} set to $offon[$env{'form.autoassign_coowners'}]").'</li>'; |
|
&Apache::loncommon::devalidate_domconfig_cache($dom); |
|
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('No changes made to auto-enrollment settings'); |
$resulttext = &mt('No changes made to auto-enrollment settings'); |