[LON-CAPA-cvs] cvs: rat / lonuserstate.pm loncom/auth lonacc.pm loncom/interface lonmenu.pm lonviewclasslist.pm

raeburn raeburn@source.lon-capa.org
Thu, 25 Mar 2010 17:38:52 -0000


raeburn		Thu Mar 25 17:38:52 2010 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
    /loncom/interface	lonmenu.pm lonviewclasslist.pm 
    /rat	lonuserstate.pm 
  Log:
  - Bug 6239. Register "Course roster" (/adm/viewclasslist) if added to
    a course via Course Editor.
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.132 loncom/auth/lonacc.pm:1.133
--- loncom/auth/lonacc.pm:1.132	Wed Mar 17 00:06:14 2010
+++ loncom/auth/lonacc.pm	Thu Mar 25 17:38:35 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.132 2010/03/17 00:06:14 raeburn Exp $
+# $Id: lonacc.pm,v 1.133 2010/03/25 17:38:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -501,11 +501,12 @@
 	    $requrl=~/\.(\w+)$/;
             my $query=$r->args;
 	    if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
-		($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$ )/x) ||
+		($requrl=~/^\/adm\/.*\/(aboutme|smppg|bulletinboard)(\?|$ )/x) ||
 		($requrl=~/^\/adm\/wrapper\//) ||
 		($requrl=~m|^/adm/coursedocs/showdoc/|) ||
 		($requrl=~m|\.problem/smpedit$|) ||
-		($requrl=~/^\/public\/.*\/syllabus$/)) {
+		($requrl=~/^\/public\/.*\/syllabus$/) ||
+                ($requrl=~/^\/adm\/(viewclasslist|navmaps)$/)) {
 # ------------------------------------- This is serious stuff, get symb and log
 		my $symb;
 		if ($query) {
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.321 loncom/interface/lonmenu.pm:1.322
--- loncom/interface/lonmenu.pm:1.321	Mon Mar 22 20:11:22 2010
+++ loncom/interface/lonmenu.pm	Thu Mar 25 17:38:43 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.321 2010/03/22 20:11:22 droeschl Exp $
+# $Id: lonmenu.pm,v 1.322 2010/03/25 17:38:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -558,7 +558,7 @@
 $menuitems.="&anno-[_1]&tations[_1]&annotate()&";
 $menuitems.="Make notes and annotations about this resource&&1\n";
 
-            unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) {
+            unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist)(\?|$)/) {
 		if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
 		    $menuitems.=(<<ENDREALRES);
 s&6&3&catalog.png&catalog[_2]&info[_1]&catalog_info()&Show Metadata
@@ -616,9 +616,10 @@
                      'tools', @inlineremote[63]);
             }
             
-
-            Apache::lonhtmlcommon::add_breadcrumb_tool(
-                'advtools', @inlineremote[61,71,72,73,92]);
+            unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
+                Apache::lonhtmlcommon::add_breadcrumb_tool(
+                    'advtools', @inlineremote[61,71,72,73,92]);
+            }
         }
     }
 
Index: loncom/interface/lonviewclasslist.pm
diff -u loncom/interface/lonviewclasslist.pm:1.12 loncom/interface/lonviewclasslist.pm:1.13
--- loncom/interface/lonviewclasslist.pm:1.12	Sat Oct 17 03:11:25 2009
+++ loncom/interface/lonviewclasslist.pm	Thu Mar 25 17:38:43 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to display the classlist 
 #
-# $Id: lonviewclasslist.pm,v 1.12 2009/10/17 03:11:25 raeburn Exp $
+# $Id: lonviewclasslist.pm,v 1.13 2010/03/25 17:38:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -60,14 +60,8 @@
         $r->send_http_header;
         return OK;
     }
-#    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-#                                            ['action','state']);
-    &Apache::lonhtmlcommon::clear_breadcrumbs();
-    &Apache::lonhtmlcommon::add_breadcrumb
-        ({href=>"/adm/viewclasslist",
-          text=>"View Classlist",
-          faq=>9,bug=>'Instructor Interface',});
-    #  Needs to be in a course
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+                                            ['register']);
     if (! ($env{'request.course.fn'})) {
         $env{'user.error.msg'}=
             "/adm/viewclasslist:not in course role";
@@ -76,12 +70,18 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     #
-    my $start_page = &Apache::loncommon::start_page('Classlist');
-    my $breadcrumbs= &Apache::lonhtmlcommon::breadcrumbs(undef,
-							 'Enrollment Manager');
+    my $start_page;
+    if ($env{'form.register'}) {
+        $start_page = &Apache::loncommon::start_page('Classlist',undef,
+                             {'force_register' => $env{'form.register'}});
+    } else {
+        my $brcrum = [{'href' => 'adm/viewclasslist',
+                       'text' => 'View Classlist'},];
+        $start_page = &Apache::loncommon::start_page('Classlist',undef,
+                                                     {'bread_crumbs' => $brcrum});
+    }
     $r->print(<<ENDHEADER);
 $start_page
-$breadcrumbs
 ENDHEADER
 
     # Get classlist view settings
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.134 rat/lonuserstate.pm:1.135
--- rat/lonuserstate.pm:1.134	Thu Dec  3 19:01:33 2009
+++ rat/lonuserstate.pm	Thu Mar 25 17:38:52 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.134 2009/12/03 19:01:33 www Exp $
+# $Id: lonuserstate.pm,v 1.135 2010/03/25 17:38:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -286,7 +286,7 @@
 	$hash{'ids_'.$idsuri}=''.$rid;
     }
     
-    if ($turi=~/\/(syllabus|aboutme|navmaps|smppg|bulletinboard)$/) {
+    if ($turi=~/\/(syllabus|aboutme|navmaps|smppg|bulletinboard|viewclasslist)$/) {
 	$turi.='?register=1';
     }