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

raeburn raeburn@source.lon-capa.org
Fri, 03 Dec 2010 04:28:36 -0000


raeburn		Fri Dec  3 04:28:36 2010 EDT

  Modified files:              
    /loncom/interface	courseclassifier.pm lonsupportreq.pm 
  Log:
  - Eliminate javascript error on loading of help request form where all
    institutional codes are null.
  
  
Index: loncom/interface/courseclassifier.pm
diff -u loncom/interface/courseclassifier.pm:1.10 loncom/interface/courseclassifier.pm:1.11
--- loncom/interface/courseclassifier.pm:1.10	Fri Jul  9 14:40:20 2010
+++ loncom/interface/courseclassifier.pm	Fri Dec  3 04:28:36 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utilities for classifying courses based on institutional code
 #
-# $Id: courseclassifier.pm,v 1.10 2010/07/09 14:40:20 raeburn Exp $
+# $Id: courseclassifier.pm,v 1.11 2010/12/03 04:28:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,8 +40,10 @@
     my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.','.',                                                undef,undef,'Course');
     foreach my $course (keys(%courses)) {
         if (ref($courses{$course}) eq 'HASH') {
-            $$coursecodes{$course} = $courses{$course}{'inst_code'};
-            $totcodes ++;
+            if ($courses{$course}{'inst_code'} ne '') {
+                $$coursecodes{$course} = $courses{$course}{'inst_code'};
+                $totcodes ++;
+            }
         }
     }
     return $totcodes;
Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.61 loncom/interface/lonsupportreq.pm:1.62
--- loncom/interface/lonsupportreq.pm:1.61	Thu Dec  2 23:05:42 2010
+++ loncom/interface/lonsupportreq.pm	Fri Dec  3 04:28:36 2010
@@ -1,5 +1,5 @@
 #
-# $Id: lonsupportreq.pm,v 1.61 2010/12/02 23:05:42 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.62 2010/12/03 04:28:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -244,7 +244,7 @@
     }
 	
     my $js = '<script type="text/javascript">'."\n$scripttag\n$jscript\n".
-	'</script>';
+	     $loaditems.'</script>';
     my %add_entries = (topmargin    => "0",
 		       marginheight => "0",
 		       onLoad       =>"initialize_codes()",);