--- loncom/interface/domainprefs.pm 2017/03/13 21:20:18 1.160.6.80
+++ loncom/interface/domainprefs.pm 2018/11/24 16:48:01 1.342
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.80 2017/03/13 21:20:18 raeburn Exp $
+# $Id: domainprefs.pm,v 1.342 2018/11/24 16:48:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,7 +27,7 @@
#
#
###############################################################
-##############################################################
+###############################################################
=pod
@@ -104,8 +104,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, placement, and lti).
+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:
@@ -170,10 +170,12 @@ use Apache::loncoursequeueadmin();
use LONCAPA qw(:DEFAULT :match);
use LONCAPA::Enrollment;
use LONCAPA::lonauthcgi();
+use LONCAPA::SSL;
use File::Copy;
use Locale::Language;
use DateTime::TimeZone;
use DateTime::Locale;
+use Time::HiRes qw( sleep );
my $registered_cleanup;
my $modified_urls;
@@ -216,13 +218,40 @@ sub handler {
'contacts','defaults','scantron','coursecategories',
'serverstatuses','requestcourses','helpsettings',
'coursedefaults','usersessions','loadbalancing',
- 'requestauthor','selfenrollment','inststatus'],$dom);
+ 'requestauthor','selfenrollment','inststatus',
+ 'ltitools','ssl','trust','lti'],$dom);
+ my %encconfig =
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti'],$dom);
+ if (ref($domconfig{'ltitools'}) eq 'HASH') {
+ if (ref($encconfig{'ltitools'}) eq 'HASH') {
+ foreach my $id (keys(%{$domconfig{'ltitools'}})) {
+ if ((ref($domconfig{'ltitools'}{$id}) eq 'HASH') &&
+ (ref($encconfig{'ltitools'}{$id}) eq 'HASH')) {
+ foreach my $item ('key','secret') {
+ $domconfig{'ltitools'}{$id}{$item} = $encconfig{'ltitools'}{$id}{$item};
+ }
+ }
+ }
+ }
+ }
+ if (ref($domconfig{'lti'}) eq 'HASH') {
+ if (ref($encconfig{'lti'}) eq 'HASH') {
+ foreach my $id (keys(%{$domconfig{'lti'}})) {
+ if ((ref($domconfig{'lti'}{$id}) eq 'HASH') &&
+ (ref($encconfig{'lti'}{$id}) eq 'HASH')) {
+ foreach my $item ('key','secret') {
+ $domconfig{'lti'}{$id}{$item} = $encconfig{'lti'}{$id}{$item};
+ }
+ }
+ }
+ }
+ }
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
'autoupdate','autocreate','directorysrch','contacts',
'usercreation','selfcreation','usermodification','scantron',
'requestcourses','requestauthor','coursecategories',
'serverstatuses','helpsettings','coursedefaults',
- 'selfenrollment','usersessions');
+ 'ltitools','selfenrollment','usersessions','ssl','trust','lti');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -265,7 +294,7 @@ sub handler {
{col1 => 'Internal Authentication',
col2 => 'Value'},
{col1 => 'Institutional user types',
- col2 => 'Assignable to e-mail usernames'}],
+ col2 => 'Name displayed'}],
print => \&print_defaults,
modify => \&modify_defaults,
},
@@ -323,6 +352,8 @@ sub handler {
col2 => 'Value',},
{col1 => 'Recipient(s) for notifications',
col2 => 'Value',},
+ {col1 => 'Nightly status check e-mail',
+ col2 => 'Settings',},
{col1 => 'Ask helpdesk form settings',
col2 => 'Value',},],
print => \&print_contacts,
@@ -347,7 +378,7 @@ sub handler {
col2 => 'Enabled?'},
{col1 => 'Institutional user type (login/SSO self-creation)',
col2 => 'Information user can enter'},
- {col1 => 'Self-creation with e-mail as username',
+ {col1 => 'Self-creation with e-mail verification',
col2 => 'Settings'}],
print => \&print_selfcreation,
modify => \&modify_selfcreation,
@@ -452,6 +483,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',
@@ -475,6 +514,60 @@ sub handler {
print => \&print_loadbalancing,
modify => \&modify_loadbalancing,
},
+ 'ltitools' =>
+ {text => 'External Tools (LTI)',
+ help => 'Domain_Configuration_LTI_Tools',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ print => \&print_ltitools,
+ modify => \&modify_ltitools,
+ },
+ 'ssl' =>
+ {text => 'LON-CAPA Network (SSL)',
+ help => 'Domain_Configuration_Network_SSL',
+ header => [{col1 => 'Server',
+ col2 => 'Certificate Status'},
+ {col1 => 'Connections to other servers',
+ col2 => 'Rules'},
+ {col1 => 'Connections from other servers',
+ col2 => 'Rules'},
+ {col1 => "Replicating domain's published content",
+ col2 => 'Rules'}],
+ print => \&print_ssl,
+ modify => \&modify_ssl,
+ },
+ 'trust' =>
+ {text => 'Trust Settings',
+ help => 'Domain_Configuration_Trust',
+ header => [{col1 => "Access to this domain's content by others",
+ col2 => 'Rules'},
+ {col1 => "Access to other domain's content by this domain",
+ col2 => 'Rules'},
+ {col1 => "Enrollment in this domain's courses by others",
+ col2 => 'Rules',},
+ {col1 => "Co-author roles in this domain for others",
+ col2 => 'Rules',},
+ {col1 => "Co-author roles for this domain's users elsewhere",
+ col2 => 'Rules',},
+ {col1 => "Domain roles in this domain assignable to others",
+ col2 => 'Rules'},
+ {col1 => "Course catalog for this domain displayed elsewhere",
+ col2 => 'Rules'},
+ {col1 => "Requests for creation of courses in this domain by others",
+ col2 => 'Rules'},
+ {col1 => "Users in other domains can send messages to this domain",
+ col2 => 'Rules'},],
+ print => \&print_trust,
+ modify => \&modify_trust,
+ },
+ 'lti' =>
+ {text => 'LTI Provider',
+ help => 'Domain_Configuration_LTI_Provider',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ print => \&print_lti,
+ modify => \&modify_lti,
+ },
);
if (keys(%servers) > 1) {
$prefs{'login'} = { text => 'Log-in page options',
@@ -528,6 +621,9 @@ $javascript_validations
$coursebrowserjs
END
}
+ if (grep(/^selfcreation$/,@actions)) {
+ $js .= &selfcreate_javascript();
+ }
if (grep(/^contacts$/,@actions)) {
$js .= &contacts_javascript();
}
@@ -620,11 +716,11 @@ sub process_changes {
} elsif ($action eq 'autocreate') {
$output = &modify_autocreate($dom,%domconfig);
} elsif ($action eq 'directorysrch') {
- $output = &modify_directorysrch($dom,%domconfig);
+ $output = &modify_directorysrch($dom,$lastactref,%domconfig);
} elsif ($action eq 'usercreation') {
$output = &modify_usercreation($dom,%domconfig);
} elsif ($action eq 'selfcreation') {
- $output = &modify_selfcreation($dom,%domconfig);
+ $output = &modify_selfcreation($dom,$lastactref,%domconfig);
} elsif ($action eq 'usermodification') {
$output = &modify_usermodification($dom,%domconfig);
} elsif ($action eq 'contacts') {
@@ -651,6 +747,14 @@ sub process_changes {
$output = &modify_usersessions($dom,$lastactref,%domconfig);
} elsif ($action eq 'loadbalancing') {
$output = &modify_loadbalancing($dom,%domconfig);
+ } elsif ($action eq 'ltitools') {
+ $output = &modify_ltitools($r,$dom,$action,$lastactref,%domconfig);
+ } elsif ($action eq 'ssl') {
+ $output = &modify_ssl($dom,$lastactref,%domconfig);
+ } elsif ($action eq 'trust') {
+ $output = &modify_trust($dom,$lastactref,%domconfig);
+ } elsif ($action eq 'lti') {
+ $output = &modify_lti($r,$dom,$action,$lastactref,%domconfig);
}
return $output;
}
@@ -677,13 +781,17 @@ sub print_config_box {
&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,
+ &Apache::lonuserutils::custom_roledefs_js($context,$crstype,$formname,\%full,
\@templateroles);
+ } elsif ($action eq 'ltitools') {
+ $output .= <itools_javascript($settings);
+ } elsif ($action eq 'lti') {
+ $output .= <i_javascript($settings);
}
$output .=
'
+
+
+
+ '.&mt($item->{'header'}->[3]->{'col1'}).' |
+ '.&mt($item->{'header'}->[3]->{'col2'}).' | '.
+ $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'login') {
if ($numheaders == 4) {
$output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
@@ -844,8 +1024,8 @@ sub print_config_box {
- '.&mt($item->{'header'}->[4]->{'col1'}).' |
- '.&mt($item->{'header'}->[4]->{'col2'}).' |
+ '.&mt($item->{'header'}->[4]->{'col1'}).' |
+ '.&mt($item->{'header'}->[4]->{'col2'}).' |
'.
&print_validation_rows('requestcourses',$dom,$settings,\$rowtotal);
} elsif ($action eq 'requestauthor') {
@@ -860,9 +1040,9 @@ sub print_config_box {
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col1'}).' |
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col2'}).' |
'.
&print_rolecolors($phase,'author',$dom,$confname,$settings,\$rowtotal).'
@@ -890,30 +1070,30 @@ sub print_config_box {
'.&mt($item->{'header'}->[0]->{'col1'}).' | ';
} elsif ($action eq 'serverstatuses') {
$output .= '
- '.&mt($item->{'header'}->[0]->{'col1'}).
+ | '.&mt($item->{'header'}->[0]->{'col1'}).
' ('.&mt('Automatic access for Dom. Coords.').') | ';
} else {
$output .= '
- '.&mt($item->{'header'}->[0]->{'col1'}).' | ';
+ '.&mt($item->{'header'}->[0]->{'col1'}).' | ';
}
if (defined($item->{'header'}->[0]->{'col3'})) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col2'});
if ($action eq 'serverstatuses') {
$output .= ' ('.&mt('user1:domain1,user2:domain2 etc.').')';
}
} else {
- $output .= ' | '.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col2'});
}
$output .= ' | ';
if ($item->{'header'}->[0]->{'col3'}) {
if (defined($item->{'header'}->[0]->{'col4'})) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col3'});
} else {
- $output .= ' | '.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col3'});
}
if ($action eq 'serverstatuses') {
@@ -922,7 +1102,7 @@ sub print_config_box {
$output .= ' | ';
}
if ($item->{'header'}->[0]->{'col4'}) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col4'});
}
$output .= '';
@@ -930,7 +1110,8 @@ sub print_config_box {
if ($action eq 'quotas') {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
} elsif (($action eq 'autoenroll') || ($action eq 'autocreate') ||
- ($action eq 'serverstatuses') || ($action eq 'loadbalancing')) {
+ ($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
+ ($action eq 'ltitools') || ($action eq 'lti')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
} elsif ($action eq 'scantron') {
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
@@ -954,7 +1135,7 @@ sub print_login {
my $choice = $choices{'disallowlogin'};
$css_class = ' class="LC_odd_row"';
$datatable .= ' | '.$choice.' | '.
- ''.$choices{'hostid'}.' | '.
+ ''.$choices{'hostid'}.' | '.
''.$choices{'server'}.' | '.
''.$choices{'serverpath'}.' | '.
''.$choices{'custompath'}.' | '.
@@ -1235,7 +1416,7 @@ sub print_login {
my $choice = $choices{'headtag'};
$css_class = ' class="LC_odd_row"';
$datatable .= '
---|
'.$choice.' | '.
- ''.$choices{'hostid'}.' | '.
+ ' | ';
}
@@ -1438,7 +1619,7 @@ sub display_color_options {
my $datatable = ''.
''.$choices->{'font'}.' | ';
if (!$is_custom->{'font'}) {
- $datatable .= ''.&mt('Default in use:').' '.$defaults->{'font'}.' | ';
+ $datatable .= ''.&mt('Default in use:').' '.$defaults->{'font'}.' | ';
} else {
$datatable .= ' | ';
}
@@ -1447,12 +1628,12 @@ sub display_color_options {
$datatable .= ''.
' '.
- ' | ';
+ ' ';
unless ($role eq 'login') {
$datatable .= ''.
''.$choices->{'fontmenu'}.' | ';
if (!$is_custom->{'fontmenu'}) {
- $datatable .= ''.&mt('Default in use:').' '.$defaults->{'fontmenu'}.' | ';
+ $datatable .= ''.&mt('Default in use:').' '.$defaults->{'fontmenu'}.' | ';
} else {
$datatable .= ' | ';
}
@@ -1462,7 +1643,7 @@ sub display_color_options {
' '.
- ' ';
+ ' ';
}
my $switchserver = &check_switchserver($dom,$confname);
foreach my $img (@{$images}) {
@@ -1521,7 +1702,8 @@ sub display_color_options {
if ($fullwidth ne '' && $fullheight ne '') {
if ($fullwidth > $width && $fullheight > $height) {
my $size = $width.'x'.$height;
- system("convert -sample $size $input $output");
+ my @args = ('convert','-sample',$size,$input,$output);
+ system({$args[0]} @args);
$showfile = "/$imgdir/tn-".$filename;
}
}
@@ -1579,7 +1761,7 @@ sub display_color_options {
my $bgs_def;
foreach my $item (@{$bgs}) {
if (!$is_custom->{$item}) {
- $bgs_def .= ''.$choices->{$item}.' '.$defaults->{'bgs'}{$item}.' | ';
+ $bgs_def .= ''.$choices->{$item}.' '.$defaults->{'bgs'}{$item}.' | ';
}
}
if ($bgs_def) {
@@ -1591,7 +1773,7 @@ sub display_color_options {
'';
foreach my $item (@{$bgs}) {
- $datatable .= ''.$choices->{$item};
+ $datatable .= ' | '.$choices->{$item};
my $color = $designs->{'bgs'}{$item} ? $designs->{'bgs'}{$item} : $defaults->{'bgs'}{$item};
if ($designs->{'bgs'}{$item}) {
$datatable .= ' ';
@@ -1607,7 +1789,7 @@ sub display_color_options {
my $links_def;
foreach my $item (@{$links}) {
if (!$is_custom->{$item}) {
- $links_def .= ' | '.$choices->{$item}.' '.$defaults->{'links'}{$item}.' | ';
+ $links_def .= ''.$choices->{$item}.' '.$defaults->{'links'}{$item}.' | ';
}
}
if ($links_def) {
@@ -1619,7 +1801,7 @@ sub display_color_options {
'';
foreach my $item (@{$links}) {
my $color = $designs->{'links'}{$item} ? $designs->{'links'}{$item} : $defaults->{'links'}{$item};
- $datatable .= ''.$choices->{$item}."\n";
+ $datatable .= ' | '.$choices->{$item}."\n";
if ($designs->{'links'}{$item}) {
$datatable.=' ';
}
@@ -1680,7 +1862,7 @@ sub login_text_colors {
my ($img,$role,$logintext,$phase,$choices,$designs,$defaults) = @_;
my $color_menu = '';
foreach my $item (@{$logintext}) {
- $color_menu .= ''.$choices->{$item};
+ $color_menu .= ' | '.$choices->{$item};
my $color = $designs->{'logintext'}{$item} ? $designs->{'logintext'}{$item} : $defaults->{'logintext'}{$item};
$color_menu .= '
| ';
@@ -1693,17 +1875,15 @@ sub image_changes {
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_;
my $output;
if ($img eq 'login') {
- # suppress image for Log-in header
+ $output = ''.$logincolors; # suppress image for Log-in header
} elsif (!$is_custom) {
if ($img ne 'domlogo') {
- $output .= &mt('Default image:').' ';
+ $output = &mt('Default image:').' ';
} else {
- $output .= &mt('Default in use:').' ';
+ $output = &mt('Default in use:').' ';
}
}
- if ($img eq 'login') { # suppress image for Log-in header
- $output .= ' | '.$logincolors;
- } else {
+ if ($img ne 'login') {
if ($img_import) {
$output .= '';
}
@@ -1715,7 +1895,7 @@ sub image_changes {
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?').
' '.&mt('Replace:').' ';
} else {
- $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
}
}
return $output;
@@ -1734,7 +1914,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','lti');
@options =('norequest','approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($dom);
%titles = &courserequest_titles();
@@ -2147,7 +2327,7 @@ sub print_quotas {
}
sub print_requestmail {
- my ($dom,$action,$settings,$rowtotal) = @_;
+ my ($dom,$action,$settings,$rowtotal,$customcss,$rowstyle) = @_;
my ($now,$datatable,%currapp);
$now = time;
if (ref($settings) eq 'HASH') {
@@ -2159,7 +2339,19 @@ sub print_requestmail {
}
my $numinrow = 2;
my $css_class;
- $css_class = ($$rowtotal%2? ' class="LC_odd_row"':'');
+ if ($$rowtotal%2) {
+ $css_class = 'LC_odd_row';
+ }
+ if ($customcss) {
+ $css_class .= " $customcss";
+ }
+ $css_class =~ s/^\s+//;
+ if ($css_class) {
+ $css_class = ' class="'.$css_class.'"';
+ }
+ if ($rowstyle) {
+ $css_class .= ' style="'.$rowstyle.'"';
+ }
my $text;
if ($action eq 'requestcourses') {
$text = &mt('Receive notification of course requests requiring approval');
@@ -2186,7 +2378,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','lti');
if (ref($settings) eq 'HASH') {
if (ref($settings->{'uniquecode'}) eq 'HASH') {
foreach my $type (@crstypes) {
@@ -2282,8 +2474,7 @@ sub print_textbookcourses {
(' 'x2).
''.&mt('Thumbnail:');
if ($image) {
- $datatable .= ''.
- $imgsrc.
+ $datatable .= $imgsrc.
' '.
' '.&mt('Replace:').' ';
@@ -2314,7 +2505,7 @@ sub print_textbookcourses {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').' | '."\n".
+ ''.&mt('Add').''."\n".
''.
''.&mt('Subject:').' '."\n".
(' 'x2).
@@ -2331,13 +2522,13 @@ sub print_textbookcourses {
} else {
$datatable .= '';
}
+ $datatable .= ''."\n";
}
- $datatable .= ''."\n".
- ''.&mt('LON-CAPA course:').' '.
+ $datatable .= ''.&mt('LON-CAPA course:').' '.
&Apache::loncommon::select_dom_form($env{'request.role.domain'},$type.'_addbook_cdom').
''.
&Apache::loncommon::selectcourse_link
- ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course');
+ ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course').
' | '."\n".
' '."\n";
$itemcount ++;
@@ -2437,6 +2628,359 @@ $jstext{'templates'};
ENDSCRIPT
}
+sub ltitools_javascript {
+ my ($settings) = @_;
+ my $togglejs = <itools_toggle_js();
+ unless (ref($settings) eq 'HASH') {
+ return $togglejs;
+ }
+ my (%ordered,$total,%jstext);
+ $total = 0;
+ foreach my $item (keys(%{$settings})) {
+ if (ref($settings->{$item}) eq 'HASH') {
+ my $num = $settings->{$item}{'order'};
+ $ordered{$num} = $item;
+ }
+ }
+ $total = scalar(keys(%{$settings}));
+ my @jsarray = ();
+ foreach my $item (sort {$a <=> $b } (keys(%ordered))) {
+ push(@jsarray,$ordered{$item});
+ }
+ my $jstext = ' var ltitools = Array('."'".join("','",@jsarray)."'".');'."\n";
+ return <<"ENDSCRIPT";
+
+
+$togglejs
+
+ENDSCRIPT
+}
+
+sub ltitools_toggle_js {
+ return <<"ENDSCRIPT";
+
+
+ENDSCRIPT
+}
+
+sub lti_javascript {
+ my ($settings) = @_;
+ my $togglejs = <i_toggle_js();
+ unless (ref($settings) eq 'HASH') {
+ return $togglejs;
+ }
+ my (%ordered,$total,%jstext);
+ $total = 0;
+ foreach my $item (keys(%{$settings})) {
+ if (ref($settings->{$item}) eq 'HASH') {
+ my $num = $settings->{$item}{'order'};
+ $ordered{$num} = $item;
+ }
+ }
+ $total = scalar(keys(%{$settings}));
+ my @jsarray = ();
+ foreach my $item (sort {$a <=> $b } (keys(%ordered))) {
+ push(@jsarray,$ordered{$item});
+ }
+ my $jstext = ' var lti = Array('."'".join("','",@jsarray)."'".');'."\n";
+ return <<"ENDSCRIPT";
+
+
+$togglejs
+
+ENDSCRIPT
+}
+
+sub lti_toggle_js {
+ my %lcauthparmtext = &Apache::lonlocal::texthash (
+ localauth => 'Local auth argument',
+ krb => 'Kerberos domain',
+ );
+ return <<"ENDSCRIPT";
+
+
+ENDSCRIPT
+}
+
sub print_autoenroll {
my ($dom,$settings,$rowtotal) = @_;
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
@@ -2516,7 +3060,7 @@ sub print_autoenroll {
''.&mt('Failsafe for no drops when institutional data missing').' | '.
''.
' | ';
+ ' value="'.$failsafe.'" size="4" />';
$$rowtotal += 4;
return $datatable;
}
@@ -2565,7 +3109,7 @@ sub print_autoupdate {
my $locknamesettings;
$datatable .= &insttypes_row($settings,$types,$usertypes,
$dom,$numinrow,$othertitle,
- 'lockablenames');
+ 'lockablenames',$rowtotal);
$$rowtotal ++;
} else {
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
@@ -2708,7 +3252,8 @@ sub print_directorysrch {
if (ref($usertypes) eq 'HASH') {
if (keys(%{$usertypes}) > 0) {
$datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
- $numinrow,$othertitle,'cansearch');
+ $numinrow,$othertitle,'cansearch',
+ $rowtotal);
$cansrchrow = 1;
}
}
@@ -2797,7 +3342,7 @@ sub print_contacts {
my $datatable;
my @contacts = ('adminemail','supportemail');
my (%checked,%to,%otheremails,%bccemails,%includestr,%includeloc,%currfield,
- $maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings);
+ $maxsize,$fields,$fieldtitles,$fieldoptions,$possoptions,@mailings,%lonstatus);
if ($position eq 'top') {
if (ref($settings) eq 'HASH') {
foreach my $item (@contacts) {
@@ -2812,6 +3357,12 @@ sub print_contacts {
foreach my $type (@mailings) {
$otheremails{$type} = '';
}
+ } elsif ($position eq 'lower') {
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{'lonstatus'}) eq 'HASH') {
+ %lonstatus = %{$settings->{'lonstatus'}};
+ }
+ }
} else {
@mailings = ('helpdeskmail','otherdomsmail');
foreach my $type (@mailings) {
@@ -2824,7 +3375,7 @@ sub print_contacts {
($fields,$fieldtitles,$fieldoptions,$possoptions) = &helpform_fields();
}
if (ref($settings) eq 'HASH') {
- unless ($position eq 'top') {
+ unless (($position eq 'top') || ($position eq 'lower')) {
foreach my $type (@mailings) {
if (exists($settings->{$type})) {
if (ref($settings->{$type}) eq 'HASH') {
@@ -2909,7 +3460,54 @@ sub print_contacts {
$to{$item}.'" />';
$rownum ++;
}
- } else {
+ } elsif ($position eq 'bottom') {
+ $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 .= '';
+ }
+ $datatable .= ' | '."\n";
+ $rownum ++;
+ }
+ unless (($position eq 'top') || ($position eq 'lower')) {
foreach my $type (@mailings) {
$css_class = $rownum%2?' class="LC_odd_row"':'';
$datatable .= ''.
@@ -2943,7 +3541,7 @@ sub print_contacts {
'value="'.$bccemails{$type}.'" />'.
'
|
|
|
---|
| | | |