--- loncom/interface/domainprefs.pm 2017/01/18 21:24:39 1.286 +++ loncom/interface/domainprefs.pm 2017/01/28 21:35:49 1.291 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.286 2017/01/18 21:24:39 raeburn Exp $ +# $Id: domainprefs.pm,v 1.291 2017/01/28 21:35:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2958,9 +2958,6 @@ sub print_contacts { my @contacts = ('adminemail','supportemail'); my (%checked,%to,%otheremails,%bccemails,%includestr,%includeloc,%currfield, $maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings); - foreach my $type (@mailings) { - $otheremails{$type} = ''; - } if ($position eq 'top') { if (ref($settings) eq 'HASH') { foreach my $item (@contacts) { @@ -2972,8 +2969,14 @@ sub print_contacts { } elsif ($position eq 'middle') { @mailings = ('errormail','packagesmail','lonstatusmail','requestsmail', 'updatesmail','idconflictsmail'); + foreach my $type (@mailings) { + $otheremails{$type} = ''; + } } else { @mailings = ('helpdeskmail','otherdomsmail'); + foreach my $type (@mailings) { + $otheremails{$type} = ''; + } $bccemails{'helpdeskmail'} = ''; $bccemails{'otherdomsmail'} = ''; $includestr{'helpdeskmail'} = ''; @@ -3021,7 +3024,7 @@ sub print_contacts { if (exists($settings->{'helpform'}{'maxsize'})) { $maxsize = $settings->{'helpform'}{'maxsize'}; } else { - $maxsize = '1.0'; + $maxsize = '1.0'; } } else { if (ref($fields) eq 'ARRAY') { @@ -3038,7 +3041,7 @@ sub print_contacts { $to{'adminemail'} = $Apache::lonnet::perlvar{'lonAdmEMail'}; $checked{'errormail'}{'adminemail'} = ' checked="checked" '; $checked{'packagesmail'}{'adminemail'} = ' checked="checked" '; - $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; + $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; $checked{'requestsmail'}{'adminemail'} = ' checked="checked" '; $checked{'updatesmail'}{'adminemail'} = ' checked="checked" '; $checked{'idconflictsmail'}{'adminemail'} = ' checked="checked" '; @@ -3114,8 +3117,8 @@ sub print_contacts { if ($position eq 'middle') { 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)); + &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)); @@ -3131,7 +3134,7 @@ sub print_contacts { ''.&mt('Extra helpdesk form fields:').'
'. &mt('(e-mail, subject, and description always shown)'). ''; - if ((ref($fields) eq 'ARRAY') && (ref($fieldtitles) eq 'HASH') && + if ((ref($fields) eq 'ARRAY') && (ref($fieldtitles) eq 'HASH') && (ref($fieldoptions) eq 'HASH') && (ref($possoptions) eq 'HASH')) { $datatable .= ''; foreach my $field (@{$fields}) { @@ -3185,7 +3188,7 @@ sub contacts_javascript { function screenshotSize(field) { if (document.getElementById('help_screenshotsize')) { if (field.value == 'no') { - document.getElementById('help_screenshotsize').style.display="none"; + document.getElementById('help_screenshotsize').style.display="none"; } else { document.getElementById('help_screenshotsize').style.display=""; } @@ -3247,7 +3250,7 @@ sub print_helpsettings { my $context = 'domprefs'; my $crstype = 'Course'; my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); - my @accesstypes = ('all','none'); + my @accesstypes = ('all','anydh','anyda','none'); my ($numstatustypes,@jsarray); if (ref($types) eq 'ARRAY') { if (@{$types} > 0) { @@ -3256,7 +3259,7 @@ sub print_helpsettings { @jsarray = ('bystatus'); } } - my %domhelpdesk = &Apache::lonnet::get_active_domroles($dom,['dh']); + my %domhelpdesk = &Apache::lonnet::get_active_domroles($dom,['dh','da']); if (keys(%domhelpdesk)) { push(@accesstypes,('inc','exc')); push(@jsarray,('notinc','notexc')); @@ -3465,7 +3468,7 @@ function helpdeskAccess(num) { shown = Array('notinc'); hidden = Array('notexc','bystatus'); } - if (curraccess == 'all') { + if ((curraccess == 'all') || (curraccess == 'anydh') || (curraccess == 'anyda')) { hidden = Array('notinc','notexc','bystatus'); } } @@ -3494,7 +3497,7 @@ function helpdeskAccess(num) { function toggleHelpdeskItem(num,field) { if (document.getElementById('helproles_'+num+'_'+field)) { if (document.getElementById('helproles_'+num+'_'+field).className.match(/(?:^|\\s)LC_hidden(?!\\S)/)) { - document.getElementById('helproles_'+num+'_'+field).className = + document.getElementById('helproles_'+num+'_'+field).className = document.getElementById('helproles_'+num+'_'+field).className.replace(/(?:^|\\s)LC_hidden(?!\\S)/g ,''); if (document.getElementById('helproles_'+num+'_'+field+'_vis')) { document.getElementById('helproles_'+num+'_'+field+'_vis').value = '$html_js_lt{hide}'; @@ -3522,7 +3525,9 @@ sub helpdeskroles_access { my %lt = &Apache::lonlocal::texthash( 'rou' => 'Role usage', 'whi' => 'Which helpdesk personnel may use this role?', - 'all' => 'All', + 'all' => "All with domain helpdesk or helpdesk assistant role', + 'anydh' => "All with domain helpdesk role', + 'anyda' => "All with domain helpdesk assistant role', 'none' => 'None', 'status' => 'Determined based on institutional status', 'inc' => 'Include all, but exclude specific personnel', @@ -3620,7 +3625,7 @@ sub radiobutton_prefs { } else { $datatable .= '
'.&mt('Field').''.&mt('Status').'
'; } - $datatable .= + $datatable .= ''. '