version 1.101, 2009/08/08 00:36:00
|
version 1.102, 2009/08/11 23:24:29
|
Line 297 sub handler {
|
Line 297 sub handler {
|
{text => 'Request creation of courses', |
{text => 'Request creation of courses', |
help => 'Domain_Configuration_Request_Courses', |
help => 'Domain_Configuration_Request_Courses', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Availability/Processing of requests',}], |
col2 => 'Availability/Processing of requests',}, |
|
{col1 => 'Setting', |
|
col2 => 'Value'}], |
}, |
}, |
'coursecategories' => |
'coursecategories' => |
{ text => 'Cataloging of courses', |
{ text => 'Cataloging of courses', |
Line 423 sub print_config_box {
|
Line 425 sub print_config_box {
|
$rowtotal ++; |
$rowtotal ++; |
if (($action eq 'autoupdate') || ($action eq 'rolecolors') || |
if (($action eq 'autoupdate') || ($action eq 'rolecolors') || |
($action eq 'usercreation') || ($action eq 'usermodification') || |
($action eq 'usercreation') || ($action eq 'usermodification') || |
($action eq 'coursecategories')) { |
($action eq 'coursecategories') || ($action eq 'requestcourses')) { |
my $colspan = ''; |
my $colspan = ''; |
if (($action eq 'rolecolors') || ($action eq 'coursecategories')) { |
if (($action eq 'rolecolors') || ($action eq 'coursecategories')) { |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
Line 445 sub print_config_box {
|
Line 447 sub print_config_box {
|
$output .= &print_usermodification('top',$dom,$settings,\$rowtotal); |
$output .= &print_usermodification('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
$output .= &print_coursecategories('top',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('top',$dom,$item,$settings,\$rowtotal); |
|
} elsif ($action eq 'requestcourses') { |
|
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
} else { |
} else { |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
} |
} |
Line 492 sub print_config_box {
|
Line 496 sub print_config_box {
|
$rowtotal ++; |
$rowtotal ++; |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
|
} elsif ($action eq 'requestcourses') { |
|
$output .= &print_courserequestmail($dom,$settings,\$rowtotal); |
} else { |
} else { |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
</table> |
</table> |
Line 575 sub print_config_box {
|
Line 581 sub print_config_box {
|
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'serverstatuses') { |
} elsif ($action eq 'serverstatuses') { |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
} elsif ($action eq 'requestcourses') { |
|
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
|
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 1446 sub print_quotas {
|
Line 1450 sub print_quotas {
|
return $datatable; |
return $datatable; |
} |
} |
|
|
|
sub print_courserequestmail { |
|
my ($dom,$settings,$rowtotal) = @_; |
|
my ($now,$datatable,%dompersonnel,@domcoord,@currapprove,$rows); |
|
$now = time; |
|
$rows = 0; |
|
%dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc'],$now,$now); |
|
foreach my $server (keys(%dompersonnel)) { |
|
foreach my $user (sort(keys(%{$dompersonnel{$server}}))) { |
|
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user); |
|
if (!grep(/^$uname:$udom$/,@domcoord)) { |
|
push(@domcoord,$uname.':'.$udom); |
|
} |
|
} |
|
} |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{'notify'}) eq 'HASH') { |
|
if ($settings->{'notify'}{'approval'} ne '') { |
|
@currapprove = split(',',$settings->{'notify'}{'approval'}); |
|
} |
|
} |
|
} |
|
if (@currapprove) { |
|
foreach my $dc (@currapprove) { |
|
unless (grep(/^\Q$dc\E$/,@domcoord)) { |
|
push(@domcoord,$dc); |
|
} |
|
} |
|
} |
|
@domcoord = sort(@domcoord); |
|
my $numinrow = 4; |
|
my $numdc = @domcoord; |
|
my $css_class = 'class="LC_odd_row"'; |
|
$datatable = '<tr'.$css_class.'>'. |
|
' <td>'.&mt('Receive notification of course requests requiring approval.'). |
|
' </td>'. |
|
' <td class="LC_left_item">'; |
|
if (@domcoord > 0) { |
|
$datatable .= '<table>'; |
|
for (my $i=0; $i<$numdc; $i++) { |
|
my $rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$datatable .= '</tr>'; |
|
} |
|
$datatable .= '<tr>'; |
|
$rows ++; |
|
} |
|
my $check = ' '; |
|
if (grep(/^\Q$domcoord[$i]\E$/,@currapprove)) { |
|
$check = ' checked="checked" '; |
|
} |
|
my ($uname,$udom) = split(':',$domcoord[$i]); |
|
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
|
if ($i == $numdc-1) { |
|
my $colsleft = $numinrow-$rem; |
|
if ($colsleft > 1) { |
|
$datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
|
} else { |
|
$datatable .= '<td class="LC_left_item">'; |
|
} |
|
} else { |
|
$datatable .= '<td class="LC_left_item">'; |
|
} |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="reqapprovalnotify" '. |
|
'value="'.$domcoord[$i].'"'.$check.'/>'. |
|
$fullname.'</label></span></td>'; |
|
} |
|
$datatable .= '</tr></table>'; |
|
} else { |
|
$datatable .= &mt('There are no active Domain Coordinators'); |
|
$rows ++; |
|
} |
|
$datatable .='</td></tr>'; |
|
$$rowtotal += $rows; |
|
return $datatable; |
|
} |
|
|
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), |
Line 1682 sub print_contacts {
|
Line 1764 sub print_contacts {
|
my $datatable; |
my $datatable; |
my @contacts = ('adminemail','supportemail'); |
my @contacts = ('adminemail','supportemail'); |
my (%checked,%to,%otheremails); |
my (%checked,%to,%otheremails); |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail'); |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
|
'requestsmail'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$otheremails{$type} = ''; |
$otheremails{$type} = ''; |
} |
} |
Line 1713 sub print_contacts {
|
Line 1796 sub print_contacts {
|
$checked{'packagesmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'packagesmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" '; |
$checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" '; |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
|
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" '; |
} |
} |
my ($titles,$short_titles) = &contact_titles(); |
my ($titles,$short_titles) = &contact_titles(); |
my $rownum = 0; |
my $rownum = 0; |
Line 1758 sub contact_titles {
|
Line 1842 sub contact_titles {
|
'packagesmail' => 'Package update alerts to be e-mailed to', |
'packagesmail' => 'Package update alerts to be e-mailed to', |
'helpdeskmail' => 'Helpdesk requests to be e-mailed to', |
'helpdeskmail' => 'Helpdesk requests to be e-mailed to', |
'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', |
); |
); |
my %short_titles = &Apache::lonlocal::texthash ( |
my %short_titles = &Apache::lonlocal::texthash ( |
adminemail => 'Admin E-mail address', |
adminemail => 'Admin E-mail address', |
Line 3715 sub modify_quotas {
|
Line 3800 sub modify_quotas {
|
} |
} |
} |
} |
} |
} |
unless ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
|
my @approvalnotify = &Apache::loncommon::get_env_multiple('form.reqapprovalnotify'); |
|
@approvalnotify = sort(@approvalnotify); |
|
$confhash{'notify'}{'approval'} = join(',',@approvalnotify); |
|
if (ref($domconfig{$action}) eq 'HASH') { |
|
if (ref($domconfig{$action}{'notify'}) eq 'HASH') { |
|
if ($domconfig{$action}{'notify'}{'approval'} ne $confhash{'notify'}{'approval'}) { |
|
$changes{'notify'}{'approval'} = 1; |
|
} |
|
} else { |
|
if ($domconfig{$action}{'notify'}{'approval'}) { |
|
$changes{'notify'}{'approval'} = 1; |
|
} |
|
} |
|
} else { |
|
if ($domconfig{$action}{'notify'}{'approval'}) { |
|
$changes{'notify'}{'approval'} = 1; |
|
} |
|
} |
|
} else { |
$confhash{'defaultquota'}{'default'} = $env{'form.defaultquota'}; |
$confhash{'defaultquota'}{'default'} = $env{'form.defaultquota'}; |
} |
} |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
Line 3885 sub modify_quotas {
|
Line 3989 sub modify_quotas {
|
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
} |
} |
|
if ($action eq 'requestcourses') { |
|
if (ref($changes{'notify'}) eq 'HASH') { |
|
if ($changes{'notify'}{'approval'}) { |
|
if (ref($confhash{'notify'}) eq 'HASH') { |
|
if ($confhash{'notify'}{'approval'}) { |
|
$resulttext .= '<li>'.&mt('Notification of requests requiring approval will be sent to: ').$confhash{'notify'}{'approval'}.'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No Domain Coordinators will receive notification of course requests requiring approval.').'</li>'; |
|
} |
|
} |
|
} |
|
} |
|
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
if (keys(%newenv)) { |
if (keys(%newenv)) { |
&Apache::lonnet::appenv(\%newenv); |
&Apache::lonnet::appenv(\%newenv); |
Line 4277 sub modify_contacts {
|
Line 4394 sub modify_contacts {
|
} |
} |
my (%others,%to); |
my (%others,%to); |
my @contacts = ('supportemail','adminemail'); |
my @contacts = ('supportemail','adminemail'); |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail'); |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
|
'requestsmail'); |
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 4323 sub modify_contacts {
|
Line 4441 sub modify_contacts {
|
$default{'packagesmail'} = 'adminemail'; |
$default{'packagesmail'} = 'adminemail'; |
$default{'helpdeskmail'} = 'supportemail'; |
$default{'helpdeskmail'} = 'supportemail'; |
$default{'lonstatusmail'} = 'adminemail'; |
$default{'lonstatusmail'} = 'adminemail'; |
|
$default{'requestsmail'} = 'adminemail'; |
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; |