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

raeburn raeburn at source.lon-capa.org
Sun Jan 5 05:55:35 EST 2014


raeburn		Sun Jan  5 10:55:35 2014 EDT

  Modified files:              
    /loncom/interface	lonrequestcourse.pm 
  Log:
  - No domain selector shown if there are no other domains to choose from.
  
  
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.74 loncom/interface/lonrequestcourse.pm:1.75
--- loncom/interface/lonrequestcourse.pm:1.74	Sat Jan  4 02:10:36 2014
+++ loncom/interface/lonrequestcourse.pm	Sun Jan  5 10:55:35 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.74 2014/01/04 02:10:36 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.75 2014/01/05 10:55:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -817,7 +817,7 @@
     return true;
 }
 END
-    my ($pagetitle,$pageinfo,$domaintitle);
+    my ($pagetitle,$pageinfo,$domaintitle,$earlyout);
     if (ref($can_request) eq 'HASH') {
         if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || $can_request->{'textbook'}) {
             if ($can_request->{'community'}) {
@@ -833,15 +833,24 @@
             $pagetitle = 'Community Requests';
             $pageinfo = &mt('Request creation of a new course, or review your pending requests.');
             $domaintitle = &mt('Community Domain');
-        } else {
+        } elsif ((ref($incdoms) eq 'ARRAY') && ((@{$incdoms} > 1) ||
+                 ((@{$incdoms} == 1) && ($incdoms->[0] ne $dom)))) {
             $pagetitle = 'Course/Community Requests';
             $pageinfo = &mt('You do not have rights to request creation of courses in this domain; please choose a different domain.');
             $domaintitle = &mt('Course/Community Domain');
+        } else {
+            $pagetitle = 'Course/Community Requests';
+            $pageinfo  = &mt('You do not have rights to request creation of courses or communities.');
+            $earlyout = 1;
         }
     }
     $r->print(&header($pagetitle,$js.$jscript,$loaditems).$crumb.
-             '<p>'.$pageinfo.'</p>'.
-             '<div>'.
+             '<p>'.$pageinfo.'</p>');
+    if ($earlyout) {
+        $r->print(&Apache::loncommon::end_page());
+        return;
+    }
+    $r->print('<div>'.
               &Apache::lonhtmlcommon::start_pick_box().
               &Apache::lonhtmlcommon::row_title($domaintitle).
               '<form name="domforcourse" method="post" action="/adm/requestcourse">'.




More information about the LON-CAPA-cvs mailing list