[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonrequestcourse.pm

raeburn raeburn at source.lon-capa.org
Sun Sep 18 16:04:02 EDT 2016


raeburn		Sun Sep 18 20:04:02 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonrequestcourse.pm 
  Log:
  - For 2.11
    - Backport 1.98
  
  
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.95.2.1 loncom/interface/lonrequestcourse.pm:1.95.2.2
--- loncom/interface/lonrequestcourse.pm:1.95.2.1	Thu Aug  4 21:59:23 2016
+++ loncom/interface/lonrequestcourse.pm	Sun Sep 18 20:04:02 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.95.2.1 2016/08/04 21:59:23 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.95.2.2 2016/09/18 20:04:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2097,6 +2097,18 @@
         $output .= &Apache::lonhtmlcommon::row_headline().
                   '<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').' '.$lt{$crstype}.' '.&mt('Include other personnel?').'</h3>';
     }
+    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("','", at linkargs);
@@ -2121,9 +2133,14 @@
         }
         $sectionselector .= $newtitle.
             '<input type="text" name="person_'.$i.'_newsec" size="15" value="" />'."\n";
-        my $usersrchlinktxt = &mt('Search for user');
-        my $usersrchlink =  &Apache::loncommon::selectuser_link($formname, at linkargs,$dom,
-                            $usersrchlinktxt);
+        my $usersrchlink;
+        if ($cansearch) {
+            my $usersrchlinktxt = &mt('Search for user');
+            $usersrchlink = &Apache::loncommon::selectuser_link($formname, at linkargs,$dom,
+                                                                $usersrchlinktxt);
+        } else {
+            $usersrchlink = ' ';
+        }
         my $userchklinktxt = &mt('Check username');
         my $userchklink = &Apache::loncommon::selectuser_link($formname, at linkargs,$dom,
                             $userchklinktxt,'checkusername');




More information about the LON-CAPA-cvs mailing list