--- loncom/interface/domainprefs.pm 2020/04/06 21:56:01 1.160.6.84.6.1
+++ loncom/interface/domainprefs.pm 2016/06/06 17:40:47 1.273
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.84.6.1 2020/04/06 21:56:01 raeburn Exp $
+# $Id: domainprefs.pm,v 1.273 2016/06/06 17:40:47 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -19,8 +19,7 @@
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
@@ -104,8 +103,8 @@ $datatable - HTML containing form eleme
In the case of course requests, radio buttons are displayed for each institutional
affiliate type (and also default, and _LC_adv) for each of the course types
-(official, unofficial, community, and textbook). In each case the radio buttons
-allow the selection of one of four values:
+(official, unofficial, community, textbook, and placement).
+In each case the radio buttons allow the selection of one of four values:
0, approval, validate, autolimit=N (where N is blank, or a positive integer).
which have the following effects:
@@ -174,6 +173,7 @@ use File::Copy;
use Locale::Language;
use DateTime::TimeZone;
use DateTime::Locale;
+use Time::HiRes qw( sleep );
my $registered_cleanup;
my $modified_urls;
@@ -218,19 +218,6 @@ sub handler {
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
'ltitools'],$dom);
- if (ref($domconfig{'ltitools'}) eq 'HASH') {
- my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools'],$dom);
- if (ref($encconfig{'ltitools'}) eq 'HASH') {
- foreach my $id (keys(%{$domconfig{'ltitools'}})) {
- if (ref($domconfig{'ltitools'}{$id}) eq 'HASH') {
- foreach my $item ('key','secret') {
- $domconfig{'ltitools'}{$id}{$item} = $encconfig{'ltitools'}{$id}{$item};
- }
- }
- }
- }
- }
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
'autoupdate','autocreate','directorysrch','contacts',
'usercreation','selfcreation','usermodification','scantron',
@@ -276,8 +263,6 @@ sub handler {
help => 'Domain_Configuration_LangTZAuth',
header => [{col1 => 'Setting',
col2 => 'Value'},
- {col1 => 'Internal Authentication',
- col2 => 'Value'},
{col1 => 'Institutional user types',
col2 => 'Assignable to e-mail usernames'}],
print => \&print_defaults,
@@ -321,24 +306,18 @@ sub handler {
modify => \&modify_autocreate,
},
'directorysrch' =>
- { text => 'Directory searches',
+ { text => 'Institutional directory searches',
help => 'Domain_Configuration_InstDirectory_Search',
- header => [{col1 => 'Institutional Directory Setting',
- col2 => 'Value',},
- {col1 => 'LON-CAPA Directory Setting',
+ header => [{col1 => 'Setting',
col2 => 'Value',}],
print => \&print_directorysrch,
modify => \&modify_directorysrch,
},
'contacts' =>
- { text => 'E-mail addresses and helpform',
+ { text => 'Contact Information',
help => 'Domain_Configuration_Contact_Info',
- header => [{col1 => 'Default e-mail addresses',
- col2 => 'Value',},
- {col1 => 'Recipient(s) for notifications',
- col2 => 'Value',},
- {col1 => 'Ask helpdesk form settings',
- col2 => 'Value',},],
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
print => \&print_contacts,
modify => \&modify_contacts,
},
@@ -435,12 +414,10 @@ sub handler {
modify => \&modify_serverstatuses,
},
'helpsettings' =>
- {text => 'Support settings',
+ {text => 'Help page settings',
help => 'Domain_Configuration_Help_Settings',
- header => [{col1 => 'Help Page Settings (logged-in users)',
- col2 => 'Value'},
- {col1 => 'Helpdesk Roles',
- col2 => 'Settings'},],
+ header => [{col1 => 'Help Settings (logged-in users)',
+ col2 => 'Value'}],
print => \&print_helpsettings,
modify => \&modify_helpsettings,
},
@@ -466,6 +443,14 @@ sub handler {
print => \&print_selfenrollment,
modify => \&modify_selfenrollment,
},
+ 'privacy' =>
+ {text => 'User Privacy',
+ help => 'Domain_Configuration_User_Privacy',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ print => \&print_privacy,
+ modify => \&modify_privacy,
+ },
'usersessions' =>
{text => 'User session hosting/offloading',
help => 'Domain_Configuration_User_Sessions',
@@ -478,7 +463,7 @@ sub handler {
print => \&print_usersessions,
modify => \&modify_usersessions,
},
- 'loadbalancing' =>
+ 'loadbalancing' =>
{text => 'Dedicated Load Balancer(s)',
help => 'Domain_Configuration_Load_Balancing',
header => [{col1 => 'Balancers',
@@ -489,14 +474,15 @@ sub handler {
print => \&print_loadbalancing,
modify => \&modify_loadbalancing,
},
- 'ltitools' =>
+ 'ltitools' =>
{text => 'External Tools (LTI)',
- help => 'Domain_Configuration_LTI_Tools',
+ help => 'Domain_configuration_LTI_Tools',
header => [{col1 => 'Setting',
col2 => 'Value',}],
print => \&print_ltitools,
modify => \&modify_ltitools,
},
+
);
if (keys(%servers) > 1) {
$prefs{'login'} = { text => 'Log-in page options',
@@ -550,9 +536,6 @@ $javascript_validations
$coursebrowserjs
END
}
- if (grep(/^contacts$/,@actions)) {
- $js .= &contacts_javascript();
- }
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js);
} else {
# check if domconfig user exists for the domain.
@@ -642,7 +625,7 @@ sub process_changes {
} elsif ($action eq 'autocreate') {
$output = &modify_autocreate($dom,%domconfig);
} elsif ($action eq 'directorysrch') {
- $output = &modify_directorysrch($dom,$lastactref,%domconfig);
+ $output = &modify_directorysrch($dom,%domconfig);
} elsif ($action eq 'usercreation') {
$output = &modify_usercreation($dom,%domconfig);
} elsif ($action eq 'selfcreation') {
@@ -664,7 +647,7 @@ sub process_changes {
} elsif ($action eq 'requestauthor') {
$output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'helpsettings') {
- $output = &modify_helpsettings($r,$dom,$confname,$lastactref,%domconfig);
+ $output = &modify_helpsettings($r,$dom,$confname,%domconfig);
} elsif ($action eq 'coursedefaults') {
$output = &modify_coursedefaults($dom,$lastactref,%domconfig);
} elsif ($action eq 'selfenrollment') {
@@ -687,22 +670,6 @@ sub print_config_box {
$output = &coursecategories_javascript($settings);
} elsif ($action eq 'defaults') {
$output = &defaults_javascript($settings);
- } elsif ($action eq 'helpsettings') {
- my (%privs,%levelscurrent);
- my %full=();
- my %levels=(
- course => {},
- domain => {},
- system => {},
- );
- my $context = 'domain';
- my $crstype = 'Course';
- my $formname = 'display';
- &Apache::lonuserutils::custom_role_privs(\%privs,\%full,\%levels,\%levelscurrent);
- my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
- $output =
- &Apache::lonuserutils::custom_roledefs_js($context,$crstype,$formname,\%full,
- \@templateroles);
}
$output .=
'
@@ -720,7 +687,6 @@ sub print_config_box {
my $colspan = '';
my $rightcolspan = '';
if (($action eq 'rolecolors') || ($action eq 'defaults') ||
- ($action eq 'directorysrch') ||
(($action eq 'login') && ($numheaders < 4))) {
$colspan = ' colspan="2"';
}
@@ -738,8 +704,7 @@ sub print_config_box {
$rowtotal ++;
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') ||
($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') ||
- ($action eq 'selfenrollment') || ($action eq 'usersessions') || ($action eq 'directorysrch') ||
- ($action eq 'helpsettings') || ($action eq 'contacts')) {
+ ($action eq 'selfenrollment') || ($action eq 'usersessions')) {
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal);
} elsif ($action eq 'coursecategories') {
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
@@ -769,8 +734,7 @@ sub print_config_box {
$rowtotal ++;
if (($action eq 'autoupdate') || ($action eq 'usercreation') ||
($action eq 'selfcreation') || ($action eq 'selfenrollment') ||
- ($action eq 'usersessions') || ($action eq 'coursecategories') ||
- ($action eq 'contacts') || ($action eq 'defaults')) {
+ ($action eq 'usersessions') || ($action eq 'coursecategories')) {
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal);
$colspan = ' colspan="2"';
@@ -795,8 +759,7 @@ sub print_config_box {
}
$rowtotal ++;
} elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') ||
- ($action eq 'defaults') || ($action eq 'directorysrch') ||
- ($action eq 'helpsettings')) {
+ ($action eq 'defaults')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'login') {
if ($numheaders == 4) {
@@ -909,7 +872,7 @@ sub print_config_box {
';
- if ($action eq 'login') {
+ if (($action eq 'login') || ($action eq 'directorysrch')) {
$output .= '
'.&mt($item->{'header'}->[0]->{'col1'}).' ';
} elsif ($action eq 'serverstatuses') {
@@ -953,12 +916,14 @@ sub print_config_box {
$rowtotal ++;
if ($action eq 'quotas') {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
- } elsif (($action eq 'autoenroll') || ($action eq 'autocreate') ||
- ($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
+ } elsif (($action eq 'autoenroll') || ($action eq 'autocreate') || ($action eq 'directorysrch') ||
+ ($action eq 'contacts') || ($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
($action eq 'ltitools')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
} elsif ($action eq 'scantron') {
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
+ } elsif ($action eq 'helpsettings') {
+ $output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);
}
}
$output .= '
@@ -1759,7 +1724,7 @@ sub print_quotas {
my $typecount = 0;
my ($css_class,%titles);
if ($context eq 'requestcourses') {
- @usertools = ('official','unofficial','community','textbook');
+ @usertools = ('official','unofficial','community','textbook','placement');
@options =('norequest','approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($dom);
%titles = &courserequest_titles();
@@ -2211,7 +2176,7 @@ sub print_studentcode {
my ($settings,$rowtotal) = @_;
my $rownum = 0;
my ($output,%current);
- my @crstypes = ('official','unofficial','community','textbook');
+ my @crstypes = ('official','unofficial','community','textbook','placement');
if (ref($settings) eq 'HASH') {
if (ref($settings->{'uniquecode'}) eq 'HASH') {
foreach my $type (@crstypes) {
@@ -2307,8 +2272,7 @@ sub print_textbookcourses {
(' 'x2).
''.&mt('Thumbnail:');
if ($image) {
- $datatable .= ''.
- $imgsrc.
+ $datatable .= $imgsrc.
' '.&mt('Delete?').' '.
' '.&mt('Replace:').' ';
@@ -2533,7 +2497,7 @@ ENDSCRIPT
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
- my ($defdom,$runon,$runoff,$coownerson,$coownersoff,$failsafe);
+ my ($defdom,$runon,$runoff,$coownerson,$coownersoff);
if (ref($settings) eq 'HASH') {
if (exists($settings->{'run'})) {
if ($settings->{'run'} eq '0') {
@@ -2567,9 +2531,6 @@ sub print_autoenroll {
if (exists($settings->{'sender_domain'})) {
$defdom = $settings->{'sender_domain'};
}
- if (exists($settings->{'autofailsafe'})) {
- $failsafe = $settings->{'autofailsafe'};
- }
} else {
if ($autorun) {
$runon = ' checked="checked" ';
@@ -2605,12 +2566,8 @@ sub print_autoenroll {
$coownerson.' value="1" />'.&mt('Yes').' '.
' '.&mt('No').' '.
- ' '.
- ''.&mt('Failsafe for no drops when institutional data missing').' '.
- ''.
- ' ';
- $$rowtotal += 4;
+ '';
+ $$rowtotal += 3;
return $datatable;
}
@@ -2739,783 +2696,231 @@ sub print_autocreate {
}
sub print_directorysrch {
- my ($position,$dom,$settings,$rowtotal) = @_;
- my $datatable;
- if ($position eq 'top') {
- my $instsrchon = ' ';
- my $instsrchoff = ' checked="checked" ';
- my ($exacton,$containson,$beginson);
- my $instlocalon = ' ';
- my $instlocaloff = ' checked="checked" ';
- if (ref($settings) eq 'HASH') {
- if ($settings->{'available'} eq '1') {
- $instsrchon = $instsrchoff;
- $instsrchoff = ' ';
- }
- if ($settings->{'localonly'} eq '1') {
- $instlocalon = $instlocaloff;
- $instlocaloff = ' ';
- }
- if (ref($settings->{'searchtypes'}) eq 'ARRAY') {
- foreach my $type (@{$settings->{'searchtypes'}}) {
- if ($type eq 'exact') {
- $exacton = ' checked="checked" ';
- } elsif ($type eq 'contains') {
- $containson = ' checked="checked" ';
- } elsif ($type eq 'begins') {
- $beginson = ' checked="checked" ';
- }
- }
- } else {
- if ($settings->{'searchtypes'} eq 'exact') {
- $exacton = ' checked="checked" ';
- } elsif ($settings->{'searchtypes'} eq 'contains') {
- $containson = ' checked="checked" ';
- } elsif ($settings->{'searchtypes'} eq 'specify') {
+ my ($dom,$settings,$rowtotal) = @_;
+ my $srchon = ' ';
+ my $srchoff = ' checked="checked" ';
+ my ($exacton,$containson,$beginson);
+ my $localon = ' ';
+ my $localoff = ' checked="checked" ';
+ if (ref($settings) eq 'HASH') {
+ if ($settings->{'available'} eq '1') {
+ $srchon = $srchoff;
+ $srchoff = ' ';
+ }
+ if ($settings->{'localonly'} eq '1') {
+ $localon = $localoff;
+ $localoff = ' ';
+ }
+ if (ref($settings->{'searchtypes'}) eq 'ARRAY') {
+ foreach my $type (@{$settings->{'searchtypes'}}) {
+ if ($type eq 'exact') {
$exacton = ' checked="checked" ';
+ } elsif ($type eq 'contains') {
$containson = ' checked="checked" ';
+ } elsif ($type eq 'begins') {
+ $beginson = ' checked="checked" ';
}
}
- }
- my ($searchtitles,$titleorder) = &sorted_searchtitles();
- my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
-
- my $numinrow = 4;
- my $cansrchrow = 0;
- $datatable=''.
- ''.&mt('Institutional directory search available?').' '.
- ''.
- ' '.&mt('Yes').' '.
- ' '.&mt('No').' '.
- ' '.
- ''.&mt('Other domains can search institution?').' '.
- ''.
- ' '.&mt('Yes').' '.
- ' '.&mt('No').' '.
- ' ';
- $$rowtotal += 2;
- if (ref($usertypes) eq 'HASH') {
- if (keys(%{$usertypes}) > 0) {
- $datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
- $numinrow,$othertitle,'cansearch');
- $cansrchrow = 1;
+ } else {
+ if ($settings->{'searchtypes'} eq 'exact') {
+ $exacton = ' checked="checked" ';
+ } elsif ($settings->{'searchtypes'} eq 'contains') {
+ $containson = ' checked="checked" ';
+ } elsif ($settings->{'searchtypes'} eq 'specify') {
+ $exacton = ' checked="checked" ';
+ $containson = ' checked="checked" ';
}
}
- if ($cansrchrow) {
- $$rowtotal ++;
- $datatable .= '';
- } else {
- $datatable .= ' ';
+ }
+ my ($searchtitles,$titleorder) = &sorted_searchtitles();
+ my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
+
+ my $numinrow = 4;
+ my $cansrchrow = 0;
+ my $datatable=' '.
+ ''.&mt('Directory search available?').' '.
+ ''.
+ ' '.&mt('Yes').' '.
+ ' '.&mt('No').' '.
+ ' '.
+ ''.&mt('Other domains can search?').' '.
+ ''.
+ ' '.&mt('Yes').' '.
+ ' '.&mt('No').' '.
+ ' ';
+ $$rowtotal += 2;
+ if (ref($usertypes) eq 'HASH') {
+ if (keys(%{$usertypes}) > 0) {
+ $datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
+ $numinrow,$othertitle,'cansearch');
+ $cansrchrow = 1;
}
- $datatable .= ''.&mt('Supported search methods').
- ' ';
+ $$rowtotal ++;
+ if ($cansrchrow) {
+ $datatable .= '';
} else {
- my $domsrchon = ' checked="checked" ';
- my $domsrchoff = ' ';
- my $domlocalon = ' ';
- my $domlocaloff = ' checked="checked" ';
- if (ref($settings) eq 'HASH') {
- if ($settings->{'lclocalonly'} eq '1') {
- $domlocalon = $domlocaloff;
- $domlocaloff = ' ';
- }
- if ($settings->{'lcavailable'} eq '0') {
- $domsrchoff = $domsrchon;
- $domsrchon = ' ';
- }
- }
- $datatable=' '.
- ''.&mt('LON-CAPA directory search available?').' '.
- ''.
- ' '.&mt('Yes').' '.
- ' '.&mt('No').' '.
- ' '.
- ''.&mt('Other domains can search LON-CAPA domain?').' '.
- ''.
- ' '.&mt('Yes').' '.
- ' '.&mt('No').' '.
- ' ';
- $$rowtotal += 2;
+ $datatable .= '';
}
+ $datatable .= ''.&mt('Search latitude').' '.
+ ''.
+ ''.
+ ' '.&mt('Exact match').
+ ' '.
+ ' '.&mt('Begins with').
+ ' '.
+ ' '.&mt('Contains').
+ ' ';
+ $$rowtotal ++;
return $datatable;
}
sub print_contacts {
- my ($position,$dom,$settings,$rowtotal) = @_;
+ my ($dom,$settings,$rowtotal) = @_;
my $datatable;
my @contacts = ('adminemail','supportemail');
- my (%checked,%to,%otheremails,%bccemails,%includestr,%includeloc,%currfield,
- $maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings);
- if ($position eq 'top') {
- if (ref($settings) eq 'HASH') {
- foreach my $item (@contacts) {
- if (exists($settings->{$item})) {
- $to{$item} = $settings->{$item};
- }
- }
- }
- } 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'} = '';
- $includestr{'otherdomsmail'} = '';
- ($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields();
+ my (%checked,%to,%otheremails,%bccemails);
+ my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail',
+ 'requestsmail','updatesmail','idconflictsmail');
+ foreach my $type (@mailings) {
+ $otheremails{$type} = '';
}
+ $bccemails{'helpdeskmail'} = '';
if (ref($settings) eq 'HASH') {
- unless ($position eq 'top') {
- foreach my $type (@mailings) {
- if (exists($settings->{$type})) {
- if (ref($settings->{$type}) eq 'HASH') {
- foreach my $item (@contacts) {
- if ($settings->{$type}{$item}) {
- $checked{$type}{$item} = ' checked="checked" ';
- }
- }
- $otheremails{$type} = $settings->{$type}{'others'};
- if (($type eq 'helpdeskmail') || ($type eq 'otherdomsmail')) {
- $bccemails{$type} = $settings->{$type}{'bcc'};
- if ($settings->{$type}{'include'} ne '') {
- ($includeloc{$type},$includestr{$type}) = split(/:/,$settings->{$type}{'include'},2);
- $includestr{$type} = &unescape($includestr{$type});
- }
- }
- }
- } elsif ($type eq 'lonstatusmail') {
- $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
- }
+ foreach my $item (@contacts) {
+ if (exists($settings->{$item})) {
+ $to{$item} = $settings->{$item};
}
}
- if ($position eq 'bottom') {
- foreach my $type (@mailings) {
- $bccemails{$type} = $settings->{$type}{'bcc'};
- if ($settings->{$type}{'include'} ne '') {
- ($includeloc{$type},$includestr{$type}) = split(/:/,$settings->{$type}{'include'},2);
- $includestr{$type} = &unescape($includestr{$type});
- }
- }
- if (ref($settings->{'helpform'}) eq 'HASH') {
- if (ref($fields) eq 'ARRAY') {
- foreach my $field (@{$fields}) {
- $currfield{$field} = $settings->{'helpform'}{$field};
+ foreach my $type (@mailings) {
+ if (exists($settings->{$type})) {
+ if (ref($settings->{$type}) eq 'HASH') {
+ foreach my $item (@contacts) {
+ if ($settings->{$type}{$item}) {
+ $checked{$type}{$item} = ' checked="checked" ';
+ }
}
- }
- if (exists($settings->{'helpform'}{'maxsize'})) {
- $maxsize = $settings->{'helpform'}{'maxsize'};
- } else {
- $maxsize = '1.0';
- }
- } else {
- if (ref($fields) eq 'ARRAY') {
- foreach my $field (@{$fields}) {
- $currfield{$field} = 'yes';
+ $otheremails{$type} = $settings->{$type}{'others'};
+ if ($type eq 'helpdeskmail') {
+ $bccemails{$type} = $settings->{$type}{'bcc'};
}
}
- $maxsize = '1.0';
+ } elsif ($type eq 'lonstatusmail') {
+ $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
}
}
} else {
- if ($position eq 'top') {
- $to{'supportemail'} = $Apache::lonnet::perlvar{'lonSupportEMail'};
- $to{'adminemail'} = $Apache::lonnet::perlvar{'lonAdmEMail'};
- $checked{'errormail'}{'adminemail'} = ' checked="checked" ';
- $checked{'packagesmail'}{'adminemail'} = ' checked="checked" ';
- $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
- $checked{'requestsmail'}{'adminemail'} = ' checked="checked" ';
- $checked{'updatesmail'}{'adminemail'} = ' checked="checked" ';
- $checked{'idconflictsmail'}{'adminemail'} = ' checked="checked" ';
- } elsif ($position eq 'bottom') {
- $checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" ';
- $checked{'otherdomsmail'}{'supportemail'} = ' checked="checked" ';
- if (ref($fields) eq 'ARRAY') {
- foreach my $field (@{$fields}) {
- $currfield{$field} = 'yes';
- }
- }
- $maxsize = '1.0';
- }
+ $to{'supportemail'} = $Apache::lonnet::perlvar{'lonSupportEMail'};
+ $to{'adminemail'} = $Apache::lonnet::perlvar{'lonAdmEMail'};
+ $checked{'errormail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'packagesmail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'helpdeskmail'}{'supportemail'} = ' checked="checked" ';
+ $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'requestsmail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'updatesmail'}{'adminemail'} = ' checked="checked" ';
+ $checked{'idconflictsmail'}{'adminemail'} = ' checked="checked" ';
}
my ($titles,$short_titles) = &contact_titles();
my $rownum = 0;
my $css_class;
- if ($position eq 'top') {
- foreach my $item (@contacts) {
- $css_class = $rownum%2?' class="LC_odd_row"':'';
- $datatable .= ''.
- ''.$titles->{$item}.
- ' '.
- ' ';
- $rownum ++;
- }
- } else {
- foreach my $type (@mailings) {
- $css_class = $rownum%2?' class="LC_odd_row"':'';
- $datatable .= ''.
- ''.
- $titles->{$type}.': '.
- '';
- if (($type eq 'helpdeskmail') || ($type eq 'otherdomsmail')) {
- $datatable .= ''.&mt('E-mail recipient(s)').' ';
- }
- $datatable .= '';
- foreach my $item (@contacts) {
- $datatable .= ''.
- ' '.$short_titles->{$item}.
- ' ';
- }
- $datatable .= ' '.&mt('Others').': '.
- ' ';
- my %locchecked;
- if (($type eq 'helpdeskmail') || ($type eq 'otherdomsmail')) {
- foreach my $loc ('s','b') {
- if ($includeloc{$type} eq $loc) {
- $locchecked{$loc} = ' checked="checked"';
- last;
- }
- }
- $datatable .= ' '.&mt('Bcc:').(' 'x6).
- ' '.
- ''.&mt('Optional added text').' '.
- &mt('Text automatically added to e-mail:').' '.
- ' '.
- ''.&mt('Location:').' '.
- ' '.&mt('in subject').' '.
- (' 'x2).
- ' '.&mt('in body').' '.
- ' ';
- }
- $datatable .= ' '."\n";
- $rownum ++;
- }
+ foreach my $item (@contacts) {
+ $css_class = $rownum%2?' class="LC_odd_row"':'';
+ $datatable .= ''.
+ ''.$titles->{$item}.
+ ' '.
+ ' ';
+ $rownum ++;
}
- 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));
- $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;
- } elsif ($position eq 'bottom') {
+ foreach my $type (@mailings) {
$css_class = $rownum%2?' class="LC_odd_row"':'';
$datatable .= ''.
- ''.&mt('Extra helpdesk form fields:').' '.
- &mt('(e-mail, subject, and description always shown)').
- ' ';
- if ((ref($fields) eq 'ARRAY') && (ref($fieldtitles) eq 'HASH') &&
- (ref($fieldoptions) eq 'HASH') && (ref($possoptions) eq 'HASH')) {
- $datatable .= '';
+ ' '.
+ $titles->{$type}.': '.
+ ''.
+ '';
+ foreach my $item (@contacts) {
+ $datatable .= ''.
+ ' '.$short_titles->{$item}.
+ ' ';
+ }
+ $datatable .= ' '.&mt('Others').': '.
+ ' ';
+ if ($type eq 'helpdeskmail') {
+ $datatable .= ' '.&mt('Bcc:').(' 'x6).
+ ' ';
}
$datatable .= ' '."\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;
return $datatable;
}
-sub contacts_javascript {
- return <<"ENDSCRIPT";
-
-
-
-ENDSCRIPT
-}
-
sub print_helpsettings {
- my ($position,$dom,$settings,$rowtotal) = @_;
- my $confname = $dom.'-domainconfig';
- my $formname = 'display';
+ my ($dom,$confname,$settings,$rowtotal) = @_;
my ($datatable,$itemcount);
- if ($position eq 'top') {
- $itemcount = 1;
- my (%choices,%defaultchecked,@toggles);
- $choices{'submitbugs'} = &mt('Display link to: [_1]?',
- &Apache::loncommon::modal_link('http://bugs.loncapa.org',
- &mt('LON-CAPA bug tracker'),600,500));
- %defaultchecked = ('submitbugs' => 'on');
- @toggles = ('submitbugs');
- ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
- \%choices,$itemcount);
- $$rowtotal ++;
- } else {
- my $css_class;
- my %existing=&Apache::lonnet::dump('roles',$dom,$confname,'rolesdef_');
- my (%customroles,%ordered,%current);
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{'adhoc'}) eq 'HASH') {
- %current = %{$settings->{'adhoc'}};
- }
- }
- my $count = 0;
- foreach my $key (sort(keys(%existing))) {
- if ($key=~/^rolesdef\_(\w+)$/) {
- my $rolename = $1;
- my (%privs,$order);
- ($privs{'system'},$privs{'domain'},$privs{'course'}) = split(/\_/,$existing{$key});
- $customroles{$rolename} = \%privs;
- if (ref($current{$rolename}) eq 'HASH') {
- $order = $current{$rolename}{'order'};
- }
- if ($order eq '') {
- $order = $count;
- }
- $ordered{$order} = $rolename;
- $count++;
- }
- }
- my $maxnum = scalar(keys(%ordered));
- my @roles_by_num = ();
- foreach my $item (sort {$a <=> $b } (keys(%ordered))) {
- push(@roles_by_num,$item);
- }
- my $context = 'domprefs';
- my $crstype = 'Course';
- my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
- my @accesstypes = ('all','dh','da','none');
- my ($numstatustypes,@jsarray);
- if (ref($types) eq 'ARRAY') {
- if (@{$types} > 0) {
- $numstatustypes = scalar(@{$types});
- push(@accesstypes,'status');
- @jsarray = ('bystatus');
- }
- }
- my %domhelpdesk = &Apache::lonnet::get_active_domroles($dom,['dh'.'da']);
- if (keys(%domhelpdesk)) {
- push(@accesstypes,('inc','exc'));
- push(@jsarray,('notinc','notexc'));
- }
- my $hiddenstr = join("','",@jsarray);
- $datatable .= &helpsettings_javascript(\@roles_by_num,$maxnum,$hiddenstr,$formname);
- my $context = 'domprefs';
- my $crstype = 'Course';
- my $prefix = 'helproles_';
- my $add_class = 'LC_hidden';
- foreach my $num (@roles_by_num) {
- my $role = $ordered{$num};
- my ($desc,$access,@statuses);
- if (ref($current{$role}) eq 'HASH') {
- $desc = $current{$role}{'desc'};
- $access = $current{$role}{'access'};
- if (ref($current{$role}{'insttypes'}) eq 'ARRAY') {
- @statuses = @{$current{$role}{'insttypes'}};
- }
- }
- if ($desc eq '') {
- $desc = $role;
- }
- my $identifier = 'custhelp'.$num;
- my %full=();
- my %levels= (
- course => {},
- domain => {},
- system => {},
- );
- my %levelscurrent=(
- course => {},
- domain => {},
- system => {},
- );
- &Apache::lonuserutils::custom_role_privs($customroles{$role},\%full,\%levels,\%levelscurrent);
- my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
- $css_class = $itemcount%2?' class="LC_odd_row"':'';
- my $chgstr = ' onchange="javascript:reorderHelpRoles(this.form,'."'helproles_".$num."_pos'".');"';
- $datatable .= ''.$role.' '.
- '';
- for (my $k=0; $k<=$maxnum; $k++) {
- my $vpos = $k+1;
- my $selstr;
- if ($k == $num) {
- $selstr = ' selected="selected" ';
- }
- $datatable .= ''.$vpos.' ';
- }
- $datatable .= ' '.(' 'x2).
- ' '.
- ' '.
- ''.&mt('Role name').' '.
- &mt('Name shown to users:').
- ' '.
- ' '.
- &helpdeskroles_access($dom,$prefix,$num,$add_class,$current{$role},\@accesstypes,
- $othertitle,$usertypes,$types,\%domhelpdesk).
- ''.
- ''.&mt('Role privileges').&adhocbutton($prefix,$num,'privs','show').' '.
- &Apache::lonuserutils::custom_role_table($crstype,\%full,\%levels,
- \%levelscurrent,$identifier,
- 'LC_hidden',$prefix.$num.'_privs').
- ' ';
- $itemcount ++;
- }
- $css_class = $itemcount%2?' class="LC_odd_row"':'';
- my $newcust = 'custhelp'.$count;
- my (%privs,%levelscurrent);
- my %full=();
- my %levels= (
- course => {},
- domain => {},
- system => {},
- );
- &Apache::lonuserutils::custom_role_privs(\%privs,\%full,\%levels,\%levelscurrent);
- my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
- my $chgstr = ' onchange="javascript:reorderHelpRoles(this.form,'."'helproles_".$count."_pos'".');"';
- $datatable .= ''.
- ' '."\n".
- '';
- for (my $k=0; $k<$maxnum+1; $k++) {
- my $vpos = $k+1;
- my $selstr;
- if ($k == $maxnum) {
- $selstr = ' selected="selected" ';
- }
- $datatable .= ''.$vpos.' ';
- }
- $datatable .= ' '."\n".
- ' '. &mt('Add').
- ' '.
- ''.&mt('Role name').' '.
- ''.
- &mt('Internal name:').
- ' '.
- ' '.(' 'x4).
- ''.
- &mt('Name shown to users:').
- ' '.
- ' '.
- &helpdeskroles_access($dom,$prefix,$count,'',undef,\@accesstypes,$othertitle,
- $usertypes,$types,\%domhelpdesk).
- ''.&mt('Role privileges').' '.
- &Apache::lonuserutils::custom_role_header($context,$crstype,
- \@templateroles,$newcust).
- &Apache::lonuserutils::custom_role_table('Course',\%full,\%levels,
- \%levelscurrent,$newcust).
- ' ';
- $count ++;
- $$rowtotal += $count;
- }
- return $datatable;
-}
-
-sub adhocbutton {
- my ($prefix,$num,$field,$visibility) = @_;
- my %lt = &Apache::lonlocal::texthash(
- show => 'Show details',
- hide => 'Hide details',
- );
- return ''.(' 'x10).
- ' '.(' 'x2).' '.(' 'x2);
-}
-
-sub helpsettings_javascript {
- my ($roles_by_num,$total,$hiddenstr,$formname) = @_;
- return unless(ref($roles_by_num) eq 'ARRAY');
- my %html_js_lt = &Apache::lonlocal::texthash(
- show => 'Show details',
- hide => 'Hide details',
- );
- &html_escape(\%html_js_lt);
- my $jstext = ' var helproles = Array('."'".join("','",@{$roles_by_num})."'".');'."\n";
- return <<"ENDSCRIPT";
-
-
-ENDSCRIPT
-}
-
-sub helpdeskroles_access {
- my ($dom,$prefix,$num,$add_class,$current,$accesstypes,$othertitle,
- $usertypes,$types,$domhelpdesk) = @_;
- return unless ((ref($accesstypes) eq 'ARRAY') && (ref($domhelpdesk) eq 'HASH'));
- my %lt = &Apache::lonlocal::texthash(
- 'rou' => 'Role usage',
- 'whi' => 'Which helpdesk personnel may use this role?',
- 'all' => 'All with domain helpdesk or helpdesk assistant role',
- 'dh' => 'All with domain helpdesk role',
- 'da' => 'All with domain helpdesk assistant role',
- 'none' => 'None',
- 'status' => 'Determined based on institutional status',
- 'inc' => 'Include all, but exclude specific personnel',
- 'exc' => 'Exclude all, but include specific personnel',
- );
- my %usecheck = (
- all => ' checked="checked"',
- );
- my %displaydiv = (
- status => 'none',
- inc => 'none',
- exc => 'none',
- priv => 'block',
- );
- my $output;
- if (ref($current) eq 'HASH') {
- if (($current->{'access'} ne '') && ($current->{'access'} ne 'all')) {
- if (grep(/^\Q$current->{access}\E$/,@{$accesstypes})) {
- $usecheck{$current->{access}} = $usecheck{'all'};
- delete($usecheck{'all'});
- if ($current->{access} =~ /^(status|inc|exc)$/) {
- my $access = $1;
- $displaydiv{$access} = 'inline';
- } elsif ($current->{access} eq 'none') {
- $displaydiv{'priv'} = 'none';
- }
- }
- }
- }
- $output = ''.$lt{'rou'}.' '.
- ''.$lt{'whi'}.'
';
- foreach my $access (@{$accesstypes}) {
- $output .= ' '.
- $lt{$access}.' ';
- if ($access eq 'status') {
- $output .= '
'.
- &Apache::lonuserutils::adhoc_status_types($dom,$prefix,$num,$current->{$access},
- $othertitle,$usertypes,$types).
- '
';
- } elsif (($access eq 'inc') && (keys(%{$domhelpdesk}) > 0)) {
- $output .= ''.
- &Apache::lonuserutils::adhoc_staff($access,$prefix,$num,$current->{$access},$domhelpdesk).
- '
';
- } elsif (($access eq 'exc') && (keys(%{$domhelpdesk}) > 0)) {
- $output .= ''.
- &Apache::lonuserutils::adhoc_staff($access,$prefix,$num,$current->{$access},$domhelpdesk).
- '
';
- }
- $output .= '';
- }
- $output .= ' ';
- return $output;
+ ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
+ \%choices,$itemcount);
+ return $datatable;
}
sub radiobutton_prefs {
@@ -3560,7 +2965,7 @@ sub radiobutton_prefs {
} else {
$datatable .= '';
}
- $datatable .=
+ $datatable .=
''.
' '.&mt('Yes').
@@ -3654,8 +3059,6 @@ sub print_ltitools {
if (ref($settings->{$item}->{'display'}) eq 'HASH') {
if ($settings->{$item}->{'display'}->{'target'} eq 'window') {
$currdisp{'window'} = ' checked="checked"';
- } elsif ($settings->{$item}->{'display'}->{'target'} eq 'tab') {
- $currdisp{'tab'} = ' checked="checked"';
} else {
$currdisp{'iframe'} = ' checked="checked"';
}
@@ -3665,12 +3068,10 @@ sub print_ltitools {
if ($settings->{$item}->{'display'}->{'height'} =~ /^(\d+)$/) {
$currdisp{'height'} = $1;
}
- $currdisp{'linktext'} = $settings->{$item}->{'display'}->{'linktext'};
- $currdisp{'explanation'} = $settings->{$item}->{'display'}->{'explanation'};
} else {
$currdisp{'iframe'} = ' checked="checked"';
}
- foreach my $disp ('iframe','tab','window') {
+ foreach my $disp ('iframe','window') {
$datatable .= ' '.
$lt{$disp}.' '.(' 'x2);
}
@@ -3680,12 +3081,6 @@ sub print_ltitools {
' '.
(' 'x2);
}
- $datatable .= ' '.
- ''.$lt{'linktext'}.' '.
- '
'.
- ''.$lt{'explanation'}.' '.
- '
';
$datatable .= ' ';
foreach my $extra ('passback','roster') {
my $checkedon = '';
@@ -3743,7 +3138,7 @@ sub print_ltitools {
if (!$rolemaps{$role}) {
$selectnone = ' selected="selected"';
}
- $datatable .= ' '.
+ $datatable .= ' '.
&Apache::lonnet::plaintext($role,'Course').' '.
''.
''.&mt('Select').' ';
@@ -3767,7 +3162,7 @@ sub print_ltitools {
}
}
$datatable .= ''.&mt('Configurable in course').' ';
- foreach my $item ('label','title','target','linktext','explanation') {
+ foreach my $item ('label','title','target') {
my $checked;
if ($courseconfig{$item}) {
$checked = ' checked="checked"';
@@ -3835,7 +3230,7 @@ sub print_ltitools {
''.&mt('Display target:');
my %defaultdisp;
$defaultdisp{'iframe'} = ' checked="checked"';
- foreach my $disp ('iframe','tab','window') {
+ foreach my $disp ('iframe','window') {
$datatable .= ' '.
$lt{$disp}.' '.(' 'x2);
}
@@ -3845,12 +3240,7 @@ sub print_ltitools {
' '.
(' 'x2);
}
- $datatable .= ' '.
- ''.$lt{'linktext'}.' '.
- '
'.
- ''.$lt{'explanation'}.' '.
- ''.
- '
';
+ $datatable .= ' ';
foreach my $extra ('passback','roster') {
$datatable .= $lt{$extra}.' '.
' '.
@@ -3888,10 +3278,10 @@ sub print_ltitools {
}
$datatable .= '
'.
''.&mt('Configurable in course').' ';
- foreach my $item ('label','title','target','linktext','explanation') {
- $datatable .= ''.
- ' '.
- $lt{'crs'.$item}.' '.(' ' x2)."\n";
+ foreach my $item ('label','title','target') {
+ $datatable .= ''.
+ ' '.
+ $lt{'crs'.$item}.' '.(' ' x2)."\n";
}
$datatable .= ' '.
''.&mt('Custom items sent on launch').' '.
@@ -3909,35 +3299,29 @@ sub print_ltitools {
sub ltitools_names {
my %lt = &Apache::lonlocal::texthash(
- 'title' => 'Title',
- 'version' => 'Version',
- 'msgtype' => 'Message Type',
- 'url' => 'URL',
- 'key' => 'Key',
- 'secret' => 'Secret',
- 'icon' => 'Icon',
- 'user' => 'Username:domain',
- 'fullname' => 'Full Name',
- 'firstname' => 'First Name',
- 'lastname' => 'Last Name',
- 'email' => 'E-mail',
- 'roles' => 'Role',
- 'window' => 'Window',
- 'tab' => 'Tab',
- 'iframe' => 'iFrame',
- 'height' => 'Height',
- 'width' => 'Width',
- 'linktext' => 'Default Link Text',
- 'explanation' => 'Default Explanation',
- 'passback' => 'Tool can return grades:',
- 'roster' => 'Tool can retrieve roster:',
- 'crstarget' => 'Display target',
- 'crslabel' => 'Course label',
- 'crstitle' => 'Course title',
- 'crslinktext' => 'Link Text',
- 'crsexplanation' => 'Explanation',
+ 'title' => 'Title',
+ 'version' => 'Version',
+ 'msgtype' => 'Message Type',
+ 'url' => 'URL',
+ 'key' => 'Key',
+ 'secret' => 'Secret',
+ 'icon' => 'Icon',
+ 'user' => 'Username:domain',
+ 'fullname' => 'Full Name',
+ 'firstname' => 'First Name',
+ 'lastname' => 'Last Name',
+ 'email' => 'E-mail',
+ 'roles' => 'Role',
+ 'window' => 'Window/Tab',
+ 'iframe' => 'iFrame',
+ 'height' => 'Height',
+ 'width' => 'Width',
+ 'passback' => 'Tool can return grades:',
+ 'roster' => 'Tool can retrieve roster:',
+ 'crstarget' => 'Display target',
+ 'crslabel' => 'Course label',
+ 'crstitle' => 'Course title',
);
-
return %lt;
}
@@ -3946,28 +3330,28 @@ sub print_coursedefaults {
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles);
my $itemcount = 1;
my %choices = &Apache::lonlocal::texthash (
+ canuse_pdfforms => 'Course/Community users can create/upload PDF forms',
uploadquota => 'Default quota for files uploaded directly to course/community using Course Editor (MB)',
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys',
coursecredits => 'Credits can be specified for courses',
uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)',
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)',
postsubmit => 'Disable submit button/keypress following student submission',
- canclone => "People who may clone a course (besides course's owner and coordinators)",
- mysqltables => 'Lifetime (s) of "Temporary" MySQL tables (student performance data) on homeserver',
+ canclone => "People who may clone a course (besides course's owner and coordinators)",
);
my %staticdefaults = (
anonsurvey_threshold => 10,
uploadquota => 500,
postsubmit => 60,
- mysqltables => 172800,
);
if ($position eq 'top') {
%defaultchecked = (
+ 'canuse_pdfforms' => 'off',
'uselcmath' => 'on',
'usejsme' => 'on',
- 'canclone' => 'none',
+ 'canclone' => 'none',
);
- @toggles = ('uselcmath','usejsme');
+ @toggles = ('canuse_pdfforms','uselcmath','usejsme');
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
\%choices,$itemcount);
$css_class = $itemcount%2?' class="LC_odd_row"':'';
@@ -4004,7 +3388,7 @@ sub print_coursedefaults {
$currcanclone = $settings->{'canclone'};
}
}
- }
+ }
foreach my $option (@cloneoptions) {
my ($checked,$additional);
if ($currcanclone eq $option) {
@@ -4043,10 +3427,10 @@ sub print_coursedefaults {
$itemcount ++;
} else {
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout,%currmysql);
+ my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout);
my $currusecredits = 0;
my $postsubmitclient = 1;
- my @types = ('official','unofficial','community','textbook');
+ my @types = ('official','unofficial','community','textbook','placement');
if (ref($settings) eq 'HASH') {
$currdefresponder = $settings->{'anonsurvey_threshold'};
if (ref($settings->{'uploadquota'}) eq 'HASH') {
@@ -4073,7 +3457,7 @@ sub print_coursedefaults {
foreach my $type (@types) {
if (ref($settings->{'postsubmit'}->{'timeout'}) eq 'HASH') {
if ($settings->{'postsubmit'}->{'timeout'}->{$type} =~ /^\d+$/) {
- $deftimeout{$type} = $settings->{'postsubmit'}->{'timeout'}->{$type};
+ $deftimeout{$type} = $settings->{'postsubmit'}->{'timeout'}->{$type};
} else {
$deftimeout{$type} = $staticdefaults{'postsubmit'};
}
@@ -4087,15 +3471,6 @@ sub print_coursedefaults {
$deftimeout{$type} = $staticdefaults{'postsubmit'};
}
}
- if (ref($settings->{'mysqltables'}) eq 'HASH') {
- foreach my $type (keys(%{$settings->{'mysqltables'}})) {
- $currmysql{$type} = $settings->{'mysqltables'}{$type};
- }
- } else {
- foreach my $type (@types) {
- $currmysql{$type} = $staticdefaults{'mysqltables'};
- }
- }
} else {
foreach my $type (@types) {
$deftimeout{$type} = $staticdefaults{'postsubmit'};
@@ -4173,27 +3548,13 @@ sub print_coursedefaults {
$additional .= '
'."\n";
%defaultchecked = ('postsubmit' => 'on');
@toggles = ('postsubmit');
- $current = {
- 'postsubmit' => $postsubmitclient,
- };
+ my $current = {
+ 'postsubmit' => $postsubmitclient,
+ };
($table,$itemcount) =
&radiobutton_prefs($current,\@toggles,\%defaultchecked,
\%choices,$itemcount,$onclick,$additional,'left');
$datatable .= $table;
- $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- $datatable .= '