[LON-CAPA-cvs] cvs: loncom /enrollment Autoenroll.pl

raeburn lon-capa-cvs@mail.lon-capa.org
Sun, 08 Feb 2004 15:47:45 -0000


raeburn		Sun Feb  8 10:47:45 2004 EDT

  Modified files:              
    /loncom/enrollment	Autoenroll.pl 
  Log:
  Fix so Autoenroll.pl will now run update when end date has been set to "No end date". Commit of change previously made to s10 on 1/28/2004. 
  
  
Index: loncom/enrollment/Autoenroll.pl
diff -u loncom/enrollment/Autoenroll.pl:1.6 loncom/enrollment/Autoenroll.pl:1.7
--- loncom/enrollment/Autoenroll.pl:1.6	Thu Dec 11 10:45:25 2003
+++ loncom/enrollment/Autoenroll.pl	Sun Feb  8 10:47:45 2004
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 #
 #Automated Enrollment script
-# $Id: Autoenroll.pl,v 1.6 2003/12/11 15:45:25 albertel Exp $
+# $Id: Autoenroll.pl,v 1.7 2004/02/08 15:47:45 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -72,7 +72,7 @@
                 $enrollvar{$crs}{$item} = &HTML::Entities::decode($settings{$item});  
             }
         }
-        if (($enrollvar{$crs}{autostart} <= $timenow) && ($enrollvar{$crs}{autoend} > $timenow)) {
+        if (($enrollvar{$crs}{autostart} <= $timenow) && ( ($enrollvar{$crs}{autoend} > $timenow) || ($enrollvar{$crs}{autoend} == 0) ) ) {
             if ( ($enrollvar{$crs}{autoadds} == 1) || ($enrollvar{$crs}{autodrops} == 1) ) {
 # Add to list of classes for retrieval
                 $enrollvar{$crs}{sectionnums} =~ s/ //g;
@@ -121,7 +121,7 @@
         my $logmsg = '';
         my $newusermsg = '';
         if ($reply{$crs} > 0) {
-            if (($enrollvar{$crs}{autostart} < $timenow) && ($enrollvar{$crs}{autoend} > $timenow)) {
+            if ( ($enrollvar{$crs}{autostart} < $timenow) && ( ($enrollvar{$crs}{autoend} > $timenow) || ($enrollvar{$crs}{autoend} == 0) ) ) {
                 if (($enrollvar{$crs}{autoadds} == 1) || ($enrollvar{$crs}{autodrops} == 1)) {
                     my ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$enrollvar{$crs}{autoadds},$enrollvar{$crs}{autodrops},$enrollvar{$crs}{startdate},$enrollvar{$crs}{enddate},$enrollvar{$crs}{authtype},$enrollvar{$crs}{autharg},\@{$affiliates{$crs}},\%{$LC_code{$crs}},\$logmsg,\$newusermsg,'automated');
                     print $fh "Messages start for $crs\n";