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

raeburn raeburn@source.lon-capa.org
Thu, 20 Aug 2009 20:49:59 -0000


raeburn		Thu Aug 20 20:49:59 2009 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Show "Course Requests" icon if user can request courses in other domain(s), even if they can't do so in their home domain.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.279 loncom/interface/lonmenu.pm:1.280
--- loncom/interface/lonmenu.pm:1.279	Wed Aug 12 18:38:04 2009
+++ loncom/interface/lonmenu.pm	Thu Aug 20 20:49:59 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.279 2009/08/12 18:38:04 raeburn Exp $
+# $Id: lonmenu.pm,v 1.280 2009/08/20 20:49:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1308,7 +1308,8 @@
 
 sub check_for_rcrs {
     my $showreqcrs = 0;
-    foreach my $type ('official','unofficial','community') {
+    my @reqtypes = ('official','unofficial','community');
+    foreach my $type (@reqtypes) {
         if (&Apache::lonnet::usertools_access($env{'user.name'},
                                               $env{'user.domain'},
                                               $type,undef,'requestcourses')) {
@@ -1316,6 +1317,14 @@
             last;
         }
     }
+    if (!$showreqcrs) {
+        foreach my $type (@reqtypes) {
+            if ($env{'environment.reqcrsotherdom.'.$type} ne '') {
+                $showreqcrs = 1;
+                last;
+            }
+        }
+    }
     return $showreqcrs;
 }