[LON-CAPA-cvs] cvs: loncom /misc refresh_courseids_db.pl

raeburn raeburn@source.lon-capa.org
Wed, 17 Mar 2010 18:16:56 -0000


raeburn		Wed Mar 17 18:16:56 2010 EDT

  Modified files:              
    /loncom/misc	refresh_courseids_db.pl 
  Log:
  - Include in hash stored in nohist_courseids.db, any of the following (if defined), from course's environment.db
    - categories, cloners, and hidefromcat, 
    - self-enrollment settings 
  
  
Index: loncom/misc/refresh_courseids_db.pl
diff -u loncom/misc/refresh_courseids_db.pl:1.2 loncom/misc/refresh_courseids_db.pl:1.3
--- loncom/misc/refresh_courseids_db.pl:1.2	Mon Mar 15 20:13:14 2010
+++ loncom/misc/refresh_courseids_db.pl	Wed Mar 17 18:16:56 2010
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # The LearningOnline Network
 #
-# $Id: refresh_courseids_db.pl,v 1.2 2010/03/15 20:13:14 raeburn Exp $
+# $Id: refresh_courseids_db.pl,v 1.3 2010/03/17 18:16:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -263,6 +263,17 @@
                     } elsif ($courseinfo{'internal.co-owners'} ne '') {
                         $courseshash->{$chome}{$cid}{'co-owners'} = $courseinfo{'internal.co-owners'};
                     }
+                    foreach my $item ('categories','cloners','hidefromcat') {
+                        if ($courseinfo{$item} ne '') {
+                            $courseshash->{$chome}{$cid}{$item} = $courseinfo{$item}; 
+                        }
+                    }
+                    foreach my $item ('selfenroll_types','selfenroll_start_date','selfenroll_end_date') {
+                        if ($courseinfo{'internal.'.$item} ne '') {
+                            $courseshash->{$chome}{$cid}{$item} =
+                                $courseinfo{'internal.'.$item};
+                        }
+                    }
                     if (keys(%changes)) {
                         if (&Apache::lonnet::put('environment',\%changes,$cdom,$cnum) eq 'ok') {
                             print $fh "Course's environment.db for ".$cdom."_".$cnum." successfully updated with following entries: ";