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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 06 Mar 2008 21:42:54 -0000


raeburn		Thu Mar  6 16:42:54 2008 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonpopulate.pm 
  Log:
  - Move &get_institutional_codes() from lonpopulate.pm to loncommon.pm
  - Add a css definition to loncommon:standard_css() 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.644 loncom/interface/loncommon.pm:1.645
--- loncom/interface/loncommon.pm:1.644	Mon Mar  3 11:41:42 2008
+++ loncom/interface/loncommon.pm	Thu Mar  6 16:42:51 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.644 2008/03/03 16:41:42 www Exp $
+# $Id: loncommon.pm,v 1.645 2008/03/06 21:42:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4790,6 +4790,14 @@
   width: 184px;
   padding: 8px;
 }
+table.LC_pick_box td.LC_selfenroll_pick_box_title {
+  background: $tabbg;
+  font-weight: bold;
+  text-align: right;
+  width: 350px;
+  padding: 8px;
+}
+
 table.LC_pick_box td.LC_pick_box_value {
   text-align: left;
   padding: 8px;
@@ -6730,6 +6738,47 @@
     return ($othertitle,$usertypes,\@types);
 }
 
+sub get_institutional_codes {
+    my ($settings,$allcourses,$LC_code) = @_;
+# Get complete list of course sections to update
+    my @currsections = ();
+    my @currxlists = ();
+    my $coursecode = $$settings{'internal.coursecode'};
+
+    if ($$settings{'internal.sectionnums'} ne '') {
+        @currsections = split(/,/,$$settings{'internal.sectionnums'});
+    }
+
+    if ($$settings{'internal.crosslistings'} ne '') {
+        @currxlists = split(/,/,$$settings{'internal.crosslistings'});
+    }
+
+    if (@currxlists > 0) {
+        foreach (@currxlists) {
+            if (m/^([^:]+):(\w*)$/) {
+                unless (grep/^$1$/,@{$allcourses}) {
+                    push @{$allcourses},$1;
+                    $$LC_code{$1} = $2;
+                }
+            }
+        }
+    }
+ 
+    if (@currsections > 0) {
+        foreach (@currsections) {
+            if (m/^(\w+):(\w*)$/) {
+                my $sec = $coursecode.$1;
+                my $lc_sec = $2;
+                unless (grep/^$sec$/,@{$allcourses}) {
+                    push @{$allcourses},$sec;
+                    $$LC_code{$sec} = $lc_sec;
+                }
+            }
+        }
+    }
+    return;
+}
+
 =pod
 
 =back
Index: loncom/interface/lonpopulate.pm
diff -u loncom/interface/lonpopulate.pm:1.52 loncom/interface/lonpopulate.pm:1.53
--- loncom/interface/lonpopulate.pm:1.52	Wed Jan  2 02:53:47 2008
+++ loncom/interface/lonpopulate.pm	Thu Mar  6 16:42:51 2008
@@ -1,5 +1,5 @@
 # automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.52 2008/01/02 07:53:47 raeburn Exp $
+# $Id: lonpopulate.pm,v 1.53 2008/03/06 21:42:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2505,7 +2505,7 @@
     my %LC_code;
     my %affiliates;
     my $outcome;
-    &get_institutional_codes(\%settings,,\@allcourses,\%LC_code);
+    &Apache::loncommon::get_institutional_codes(\%settings,\@allcourses,\%LC_code);
     if (@allcourses > 0) {
         @{$affiliates{$crs}} = @allcourses;
         $outcome = &Apache::lonnet::auto_photoupdate(\%affiliates,$dom,$crs,\%changes);
@@ -2609,7 +2609,7 @@
     } elsif ($coursecode eq '') {
 	$response = "There was a problem retrieving the course code for this LON-CAPA course.  An update of the class roster has not been carried out, and enrollment remains unchanged";
     } else {
-        &get_institutional_codes(\%settings,\@allcourses,\%LC_code);
+        &Apache::loncommon::get_institutional_codes(\%settings,\@allcourses,\%LC_code);
 	if (@allcourses > 0) {
 	    @{$affiliates{$crs}} = @allcourses;
 	    my $outcome = &Apache::lonnet::fetch_enrollment_query('updatenow',\%affiliates,\%reply,$dom,$crs);
@@ -2643,48 +2643,6 @@
     return;
 }
 
-sub get_institutional_codes {
-    my ($settings,$allcourses,$LC_code) = @_;
-# Get complete list of course sections to update
-    my @currsections = ();
-    my @currxlists = ();
-    my $coursecode = $$settings{'internal.coursecode'};
-    
-    if ($$settings{'internal.sectionnums'} ne '') {
-        @currsections = split(/,/,$$settings{'internal.sectionnums'});
-    }
-    
-    if ($$settings{'internal.crosslistings'} ne '') {
-        @currxlists = split(/,/,$$settings{'internal.crosslistings'});
-    }
-    
-    if (@currxlists > 0) {
-        foreach (@currxlists) {
-            if (m/^([^:]+):(\w*)$/) {
-                unless (grep/^$1$/,@{$allcourses}) {
-                    push @{$allcourses},$1;
-                    $$LC_code{$1} = $2;
-                }
-            }
-        }
-    }
-                                                                                       
-    if (@currsections > 0) {
-        foreach (@currsections) {
-            if (m/^(\w+):(\w*)$/) {
-                my $sec = $coursecode.$1;
-                my $lc_sec = $2;
-                unless (grep/^$sec$/,@{$allcourses}) {
-                    push @{$allcourses},$sec;
-                    $$LC_code{$sec} = $lc_sec;
-                }
-            }
-        }
-    }
-    return; 
-}
-
-
 sub print_viewclass_response {
     my ($r,$realm,$dom,$crs,$action,$tasktitleref) = @_;
     my $response;