--- loncom/interface/lonrequestcourse.pm 2016/04/04 01:09:48 1.98
+++ loncom/interface/lonrequestcourse.pm 2016/09/05 01:46:08 1.99
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Request a course
#
-# $Id: lonrequestcourse.pm,v 1.98 2016/04/04 01:09:48 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.99 2016/09/05 01:46:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2109,6 +2109,18 @@ sub print_personnel_menu {
$output .= &Apache::lonhtmlcommon::row_headline().
'
'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').' '.$lt{$crstype}.' '.&mt('Include other personnel?').'
';
}
+ my $cansearch = 1;
+ my @alldoms = &Apache::lonnet::all_domains();
+ if (@alldoms == 1) {
+ my %domsrch = &Apache::lonnet::get_dom('configuration',
+ ['directorysrch'],$alldoms[0]);
+ if (ref($domsrch{'directorysrch'}) eq 'HASH') {
+ if ((!$domsrch{'directorysrch'}{'available'}) &&
+ ($domsrch{'directorysrch'}{'lcavailable'} eq '0')) {
+ $cansearch = 0;
+ }
+ }
+ }
for (my $i=0; $i<$persontotal; $i++) {
my @linkargs = map { 'person_'.$i.'_'.$_ } (@items);
my $linkargstr = join("','",@linkargs);
@@ -2133,9 +2145,14 @@ sub print_personnel_menu {
}
$sectionselector .= $newtitle.
''."\n";
- my $usersrchlinktxt = &mt('Search for user');
- my $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,
- $usersrchlinktxt);
+ my $usersrchlink;
+ if ($cansearch) {
+ my $usersrchlinktxt = &mt('Search for user');
+ $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,
+ $usersrchlinktxt);
+ } else {
+ $usersrchlink = ' ';
+ }
my $userchklinktxt = &mt('Check username');
my $userchklink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,
$userchklinktxt,'checkusername');