- '.&mt($item->{'header'}->[0]->{'col1'}).' |
+ '.&mt($item->{'header'}->[0]->{'col1'}).' |
'.&mt($item->{'header'}->[0]->{'col2'}).' |
';
$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 'passwords') {
- $output .= $item->{'print'}->('top',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'coursecategories') {
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal);
- } elsif ($action eq 'scantron') {
- $output .= $item->{'print'}->($r,'top',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'login') {
if ($numheaders == 4) {
$colspan = ' colspan="2"';
@@ -802,13 +721,10 @@ 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 'passwords')) {
+ ($action eq 'usersessions') || ($action eq 'coursecategories')) {
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal);
$colspan = ' colspan="2"';
- } elsif ($action eq 'passwords') {
- $output .= $item->{'print'}->('middle',$dom,$confname,$settings,\$rowtotal);
} else {
$output .= $item->{'print'}->('middle',$dom,$settings,\$rowtotal);
}
@@ -820,38 +736,18 @@ sub print_config_box {
- '.&mt($item->{'header'}->[2]->{'col1'}).' |
+ '.&mt($item->{'header'}->[2]->{'col1'}).' |
'.&mt($item->{'header'}->[2]->{'col2'}).' |
'."\n";
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal);
- } elsif ($action eq 'passwords') {
- $output .= $item->{'print'}->('lower',$dom,$confname,$settings,\$rowtotal).'
-
-
- |
-
-
-
-
-
- '.&mt($item->{'header'}->[3]->{'col1'}).' |
- '.&mt($item->{'header'}->[3]->{'col2'}).' | '."\n".
- $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal).'
-
- |
-
- ';
} else {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
}
$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 'scantron') {
- $output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'login') {
if ($numheaders == 4) {
$output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
@@ -963,7 +859,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') {
@@ -1007,10 +903,13 @@ 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') ||
- ($action eq 'ltitools')) {
+ } elsif (($action eq 'autoenroll') || ($action eq 'autocreate') || ($action eq 'directorysrch') ||
+ ($action eq 'contacts') || ($action eq 'serverstatuses') || ($action eq 'loadbalancing')) {
$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 .= '
@@ -1355,7 +1254,7 @@ sub print_login {
} else {
$datatable .= '';
}
- $datatable .= ' | ';
+ $datatable .= ' | ';
}
$datatable .= ' | ';
}
@@ -1515,7 +1414,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 .= ' | ';
}
@@ -1524,12 +1423,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 .= ' | ';
}
@@ -1539,7 +1438,7 @@ sub display_color_options {
' '.
- ' ';
+ ' ';
}
my $switchserver = &check_switchserver($dom,$confname);
foreach my $img (@{$images}) {
@@ -1598,8 +1497,7 @@ sub display_color_options {
if ($fullwidth ne '' && $fullheight ne '') {
if ($fullwidth > $width && $fullheight > $height) {
my $size = $width.'x'.$height;
- my @args = ('convert','-sample',$size,$input,$output);
- system({$args[0]} @args);
+ system("convert -sample $size $input $output");
$showfile = "/$imgdir/tn-".$filename;
}
}
@@ -1657,7 +1555,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) {
@@ -1685,7 +1583,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) {
@@ -1771,15 +1669,17 @@ sub image_changes {
my ($is_custom,$alt_text,$img_import,$showfile,$fullsize,$role,$img,$imgfile,$logincolors) = @_;
my $output;
if ($img eq 'login') {
- $output = ''.$logincolors; # suppress image for Log-in header
+ # 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 ne 'login') {
+ if ($img eq 'login') { # suppress image for Log-in header
+ $output .= ' | '.$logincolors;
+ } else {
if ($img_import) {
$output .= '';
}
@@ -2223,7 +2123,7 @@ sub print_quotas {
}
sub print_requestmail {
- my ($dom,$action,$settings,$rowtotal,$customcss,$rowstyle) = @_;
+ my ($dom,$action,$settings,$rowtotal) = @_;
my ($now,$datatable,%currapp);
$now = time;
if (ref($settings) eq 'HASH') {
@@ -2235,19 +2135,7 @@ sub print_requestmail {
}
my $numinrow = 2;
my $css_class;
- 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.'"';
- }
+ $css_class = ($$rowtotal%2? ' class="LC_odd_row"':'');
my $text;
if ($action eq 'requestcourses') {
$text = &mt('Receive notification of course requests requiring approval');
@@ -2402,7 +2290,7 @@ sub print_textbookcourses {
$datatable .= '';
}
$datatable .= ' '."\n".
- ''.&mt('Add').' | '."\n".
+ ''.&mt('Add').''."\n".
''.
''.&mt('Subject:').' '."\n".
(' 'x2).
@@ -2419,13 +2307,13 @@ sub print_textbookcourses {
} else {
$datatable .= '';
}
- $datatable .= ''."\n";
}
- $datatable .= ''.&mt('LON-CAPA course:').' '.
+ $datatable .= ''."\n".
+ ''.&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 ++;
@@ -2525,112 +2413,10 @@ $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 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') {
@@ -2664,9 +2450,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" ';
@@ -2702,12 +2485,8 @@ sub print_autoenroll {
$coownerson.' value="1" />'.&mt('Yes').' '.
''.
- ''.
- ''.&mt('Failsafe for no drops when institutional data missing').' | '.
- ''.
- ' | ';
- $$rowtotal += 4;
+ '';
+ $$rowtotal += 3;
return $datatable;
}
@@ -2755,7 +2534,7 @@ sub print_autoupdate {
my $locknamesettings;
$datatable .= &insttypes_row($settings,$types,$usertypes,
$dom,$numinrow,$othertitle,
- 'lockablenames',$rowtotal);
+ 'lockablenames');
$$rowtotal ++;
} else {
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
@@ -2836,946 +2615,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('Other domains can search institution?').' | '.
- ' '.
- ' | '.
- ' ';
- $$rowtotal += 2;
- if (ref($usertypes) eq 'HASH') {
- if (keys(%{$usertypes}) > 0) {
- $datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
- $numinrow,$othertitle,'cansearch',
- $rowtotal);
- $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('Other domains can search?').' | '.
+ ' '.
+ ' | '.
+ ' ';
+ $$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('Other domains can search LON-CAPA domain?').' | '.
- ' '.
- ' | '.
- ' ';
- $$rowtotal += 2;
+ $datatable .= '';
}
+ $datatable .= ''.&mt('Search latitude').' | '.
+ ''.
+ ' '.
+ ' '.
+ ' | ';
+ $$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','hostipmail');
- 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" ';
- $checked{'hostipmail'}{'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 ++;
- }
- } elsif ($position eq 'bottom') {
+ foreach my $item (@contacts) {
+ $css_class = $rownum%2?' class="LC_odd_row"':'';
+ $datatable .= ''.
+ ''.$titles->{$item}.
+ ' | '.
+ ' | ';
+ $rownum ++;
+ }
+ 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 .= ' ';
+ }
+ $datatable .= ' '.&mt('Others').': '.
+ '';
+ if ($type eq 'helpdeskmail') {
+ $datatable .= ' '.&mt('Bcc:').(' 'x6).
+ '';
}
$datatable .= ' | '."\n";
$rownum ++;
}
- unless ($position eq 'top') {
- foreach my $type (@mailings) {
- $css_class = $rownum%2?' class="LC_odd_row"':'';
- $datatable .= ''.
- ''.
- $titles->{$type}.': | '.
- '';
- if (($type eq 'helpdeskmail') || ($type eq 'otherdomsmail')) {
- $datatable .= ''.
- '';
- }
- $datatable .= ' | '."\n";
- $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') {
- my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
- my (@posstypes,%usertypeshash);
- if (ref($types) eq 'ARRAY') {
- @posstypes = @{$types};
- }
- if (@posstypes) {
- if (ref($usertypes) eq 'HASH') {
- %usertypeshash = %{$usertypes};
- }
- my @overridden;
- my $numinrow = 4;
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{'overrides'}) eq 'HASH') {
- foreach my $key (sort(keys(%{$settings->{'overrides'}}))) {
- if (ref($settings->{'overrides'}{$key}) eq 'HASH') {
- push(@overridden,$key);
- foreach my $item (@contacts) {
- if ($settings->{'overrides'}{$key}{$item}) {
- $checked{'override_'.$key}{$item} = ' checked="checked" ';
- }
- }
- $otheremails{'override_'.$key} = $settings->{'overrides'}{$key}{'others'};
- $bccemails{'override_'.$key} = $settings->{'overrides'}{$key}{'bcc'};
- $includeloc{'override_'.$key} = '';
- $includestr{'override_'.$key} = '';
- if ($settings->{'overrides'}{$key}{'include'} ne '') {
- ($includeloc{'override_'.$key},$includestr{'override_'.$key}) =
- split(/:/,$settings->{'overrides'}{$key}{'include'},2);
- $includestr{'override_'.$key} = &unescape($includestr{'override_'.$key});
- }
- }
- }
- }
- }
- my $customclass = 'LC_helpdesk_override';
- my $optionsprefix = 'LC_options_helpdesk_';
-
- my $onclicktypes = "toggleHelpdeskRow(this.form,'overrides','$customclass','$optionsprefix');";
-
- $datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
- $numinrow,$othertitle,'overrides',
- \$rownum,$onclicktypes,$customclass);
- $rownum ++;
- $usertypeshash{'default'} = $othertitle;
- foreach my $status (@posstypes) {
- my $css_class;
- if ($rownum%2) {
- $css_class = 'LC_odd_row ';
- }
- $css_class .= $customclass;
- my $rowid = $optionsprefix.$status;
- my $hidden = 1;
- my $currstyle = 'display:none';
- if (grep(/^\Q$status\E$/,@overridden)) {
- $currstyle = 'display:table-row';
- $hidden = 0;
- }
- my $key = 'override_'.$status;
- $datatable .= &overridden_helpdesk($checked{$key},$otheremails{$key},$bccemails{$key},
- $includeloc{$key},$includestr{$key},$status,$rowid,
- $usertypeshash{$status},$css_class,$currstyle,
- \@contacts,$short_titles);
- unless ($hidden) {
- $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 overridden_helpdesk {
- my ($checked,$otheremails,$bccemails,$includeloc,$includestr,$type,$rowid,
- $typetitle,$css_class,$rowstyle,$contacts,$short_titles) = @_;
- my $class = 'LC_left_item';
- if ($css_class) {
- $css_class = ' class="'.$css_class.'"';
- }
- if ($rowid) {
- $rowid = ' id="'.$rowid.'"';
- }
- if ($rowstyle) {
- $rowstyle = ' style="'.$rowstyle.'"';
- }
- my ($output,$description);
- $description = &mt('Helpdesk requests from: [_1] in this domain (overrides default)',"$typetitle");
- $output = ''.
- "$description | \n".
- ''.
- ''.
- ''.
- ' | '."\n";
- return $output;
-}
-
-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.' '.
- ''.(' 'x2).
- ''.
- ' | '.
- ''.
- &helpdeskroles_access($dom,$prefix,$num,$add_class,$current{$role},\@accesstypes,
- $othertitle,$usertypes,$types,\%domhelpdesk).
- ' | ';
- $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 .= ' | '.
- ''.
- &helpdeskroles_access($dom,$prefix,$count,'',undef,\@accesstypes,$othertitle,
- $usertypes,$types,\%domhelpdesk).
- ''.
- &helpsettings_javascript(\@roles_by_num,$maxnum,$hiddenstr,$formname).
- ' | ';
- $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 = '';
- return $output;
+ ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
+ \%choices,$itemcount);
+ return $datatable;
}
sub radiobutton_prefs {
@@ -3820,7 +2884,7 @@ sub radiobutton_prefs {
} else {
$datatable .= '';
}
- $datatable .=
+ $datatable .=
''.
' | '."\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 .= ' |