--- loncom/interface/domainprefs.pm 2020/04/09 20:55:12 1.160.6.84.6.2
+++ loncom/interface/domainprefs.pm 2019/01/27 14:39:48 1.346
@@ -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.2 2020/04/09 20:55:12 raeburn Exp $
+# $Id: domainprefs.pm,v 1.346 2019/01/27 14:39:48 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;
@@ -217,13 +219,14 @@ sub handler {
'serverstatuses','requestcourses','helpsettings',
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
- 'ltitools'],$dom);
+ 'ltitools','ssl','trust','lti'],$dom);
+ my %encconfig =
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti'],$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') {
+ 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};
}
@@ -231,12 +234,24 @@ sub handler {
}
}
}
+ 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',
- 'ltitools','selfenrollment','usersessions');
+ 'ltitools','selfenrollment','usersessions','ssl','trust','lti');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -279,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,
},
@@ -337,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,
@@ -361,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,
@@ -377,11 +394,12 @@ sub handler {
modify => \&modify_usermodification,
},
'scantron' =>
- { text => 'Bubblesheet format file',
+ { text => 'Bubblesheet format',
help => 'Domain_Configuration_Scantron_Format',
- header => [ {col1 => 'Item',
- col2 => '',
- }],
+ header => [ {col1 => 'Bubblesheet format file',
+ col2 => ''},
+ {col1 => 'Bubblesheet data upload formats',
+ col2 => 'Settings'}],
print => \&print_scantron,
modify => \&modify_scantron,
},
@@ -466,6 +484,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',
@@ -489,7 +515,7 @@ sub handler {
print => \&print_loadbalancing,
modify => \&modify_loadbalancing,
},
- 'ltitools' =>
+ 'ltitools' =>
{text => 'External Tools (LTI)',
help => 'Domain_Configuration_LTI_Tools',
header => [{col1 => 'Setting',
@@ -497,6 +523,52 @@ sub handler {
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',
@@ -550,9 +622,15 @@ $javascript_validations
$coursebrowserjs
END
}
+ if (grep(/^selfcreation$/,@actions)) {
+ $js .= &selfcreate_javascript();
+ }
if (grep(/^contacts$/,@actions)) {
$js .= &contacts_javascript();
}
+ if (grep(/^scantron$/,@actions)) {
+ $js .= &scantron_javascript();
+ }
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js);
} else {
# check if domconfig user exists for the domain.
@@ -646,7 +724,7 @@ sub process_changes {
} 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') {
@@ -675,6 +753,12 @@ sub process_changes {
$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;
}
@@ -701,15 +785,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).'
@@ -870,8 +1032,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') {
@@ -886,9 +1048,9 @@ sub print_config_box {
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col1'}).' |
- '.
+ | '.
&mt($item->{'header'}->[2]->{'col2'}).' |
'.
&print_rolecolors($phase,'author',$dom,$confname,$settings,\$rowtotal).'
@@ -916,30 +1078,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') {
@@ -948,7 +1110,7 @@ sub print_config_box {
$output .= ' | ';
}
if ($item->{'header'}->[0]->{'col4'}) {
- $output .= ''.
+ $output .= ' | '.
&mt($item->{'header'}->[0]->{'col4'});
}
$output .= '';
@@ -956,11 +1118,9 @@ 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 'ltitools')) {
+ ($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);
}
}
$output .= '
@@ -981,7 +1141,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'}.' | '.
@@ -1262,7 +1422,7 @@ sub print_login {
my $choice = $choices{'headtag'};
$css_class = ' class="LC_odd_row"';
$datatable .= '
---|
'.$choice.' | '.
- ''.$choices{'hostid'}.' | '.
+ ' | ';
}
@@ -1465,7 +1625,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 .= ' | ';
}
@@ -1474,12 +1634,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 .= ' | ';
}
@@ -1489,7 +1649,7 @@ sub display_color_options {
' '.
- ' ';
+ ' ';
}
my $switchserver = &check_switchserver($dom,$confname);
foreach my $img (@{$images}) {
@@ -1548,7 +1708,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;
}
}
@@ -1606,7 +1767,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) {
@@ -1618,7 +1779,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 .= ' ';
@@ -1634,7 +1795,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) {
@@ -1646,7 +1807,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.=' ';
}
@@ -1707,7 +1868,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 .= '
| ';
@@ -1720,17 +1881,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 .= '';
}
@@ -1742,7 +1901,7 @@ sub image_changes {
$role.'_del_'.$img.'" value="1" />'.&mt('Delete?').
' '.&mt('Replace:').' ';
} else {
- $output .= ' | '.$logincolors.&mt('Upload:').' ';
+ $output .= ' | '.$logincolors.&mt('Upload:').' ';
}
}
return $output;
@@ -1761,7 +1920,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();
@@ -2174,7 +2333,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') {
@@ -2186,7 +2345,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');
@@ -2213,7 +2384,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) {
@@ -2309,8 +2480,7 @@ sub print_textbookcourses {
(' 'x2).
''.&mt('Thumbnail:');
if ($image) {
- $datatable .= ''.
- $imgsrc.
+ $datatable .= $imgsrc.
' '.
' '.&mt('Replace:').' ';
@@ -2341,7 +2511,7 @@ sub print_textbookcourses {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').' | '."\n".
+ ''.&mt('Add').''."\n".
''.
''.&mt('Subject:').' '."\n".
(' 'x2).
@@ -2358,13 +2528,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 ++;
@@ -2545,6 +2715,30 @@ sub ltitools_toggle_js {
function toggleLTITools(form,setting,item) {
var radioname = '';
var divid = '';
+ if ((setting == 'passback') || (setting == 'roster')) {
+ radioname = 'ltitools_'+setting+'_'+item;
+ divid = 'ltitools_'+setting+'time_'+item;
+ var num = form.elements[radioname].length;
+ if (num) {
+ var setvis = '';
+ for (var i=0; i{$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),
@@ -2645,7 +3090,7 @@ sub print_autoenroll {
''.&mt('Failsafe for no drops when institutional data missing').' | '.
''.
' | ';
+ ' value="'.$failsafe.'" size="4" />';
$$rowtotal += 4;
return $datatable;
}
@@ -2694,7 +3139,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);
@@ -2837,7 +3282,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;
}
}
@@ -2926,7 +3372,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) {
@@ -2941,6 +3387,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) {
@@ -2953,7 +3405,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') {
@@ -3038,7 +3490,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 .= ''.
@@ -3072,7 +3571,7 @@ sub print_contacts {
'value="'.$bccemails{$type}.'" />'.
'
|
|
|
---|
| | | |