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

raeburn raeburn at source.lon-capa.org
Wed Jul 3 12:44:20 EDT 2013


raeburn		Wed Jul  3 16:44:20 2013 EDT

  Modified files:              
    /loncom/interface	mydesk.tab lonmenu.pm 
  Log:
  - Do not show "Reservation" item in secondary menu if no slots have ever 
    been created in a course.
  
  
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.162 loncom/interface/mydesk.tab:1.163
--- loncom/interface/mydesk.tab:1.162	Fri Jun  7 16:07:46 2013
+++ loncom/interface/mydesk.tab	Wed Jul  3 16:44:20 2013
@@ -66,6 +66,7 @@
 #   - showsyllabus: course context and user has mdc priv, or syllabus exists
 #                   (and not included in course content).
 #   - showfeeds: course context and user has mdc priv, or course feeds exist
+#   - showresv: course context and user cannot manage grades, and slots exist
 #   - always: show this link even if user hasn't selected a role
 #   - whn: access what's new
 #   - cst: Grant/revoke role of Student:Grant/revoke role of Member 
@@ -73,7 +74,6 @@
 #   - opa: Set assessment parameters
 #   - nvgr: cannot view other people's grades 
 #   - mgr: Manage grades
-#   - nmgr: cannot manage grade
 #   - author: authors (au, ca, aa)
 #   - cca:  Grant/revoke role of co-author (author only)
 # prim:link:icon:alt:text:condition
@@ -83,7 +83,7 @@
 scnd:/adm/createuser:::People:cst
 scnd:/adm/viewclasslist:::People:ncst
 scnd:/adm/coursegroups:::Groups:showgroups
-scnd:/adm/slotrequest?command=manageresv:::Reservations:nmgr
+scnd:/adm/slotrequest?command=manageresv:::Reservations:showresv
 scnd:/adm/slotrequest?command=showslots:::Slots:mgr
 scnd:/adm/grades:::Grades:vgr
 scnd:/adm/parmset:::Settings:opa
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.416 loncom/interface/lonmenu.pm:1.417
--- loncom/interface/lonmenu.pm:1.416	Wed Jun 26 04:25:41 2013
+++ loncom/interface/lonmenu.pm	Wed Jul  3 16:44:20 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.416 2013/06/26 04:25:41 raeburn Exp $
+# $Id: lonmenu.pm,v 1.417 2013/07/03 16:44:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -329,7 +329,7 @@
     my $canmgr        = &Apache::lonnet::allowed('mgr', $crs_sec); 
     my $author        = &getauthor();
 
-    my ($cdom,$cnum,$showsyllabus,$showfeeds);
+    my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv);
     if ($env{'request.course.id'}) {
         $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -349,6 +349,12 @@
                 $showfeeds = 1;
             }
         }
+        unless ($canmgr) {
+            my %slots = &Apache::lonnet::get_course_slots($cnum,$cdom);
+            if (keys(%slots) > 0) {
+                $showresv = 1;
+            }
+        }
     }
 
     my ($canmodifycoauthor); 
@@ -385,8 +391,8 @@
                 && ($canmodifyuser || !$canviewroster);
         next if    $$menuitem[4]   eq 'mgr'
                 && !$canmgr;
-        next if    $$menuitem[4]   eq 'nmgr'
-                && $canmgr;
+        next if    $$menuitem[4]   eq 'showresv'
+                && !$showresv;
         next if    $$menuitem[4]   eq 'whn'
                 && !$canviewwnew;
         next if    $$menuitem[4]   eq 'opa'




More information about the LON-CAPA-cvs mailing list