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

www lon-capa-cvs@mail.lon-capa.org
Thu, 14 Aug 2003 14:16:42 -0000


www		Thu Aug 14 10:16:42 2003 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Bug #1542: ignore first line from uploaded courselists, e.g. column titles
  Jay Ihry
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.80 loncom/interface/londropadd.pm:1.81
--- loncom/interface/londropadd.pm:1.80	Tue Jul 29 16:00:56 2003
+++ loncom/interface/londropadd.pm	Thu Aug 14 10:16:42 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.80 2003/07/29 20:00:56 matthew Exp $
+# $Id: londropadd.pm,v 1.81 2003/08/14 14:16:42 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -198,6 +198,7 @@
 <input type="hidden" name="associate"  value="" />
 <input type="hidden" name="datatoken"  value="$datatoken" />
 <input type="hidden" name="fileupload" value="$ENV{'form.fileupload'}" />
+<input type="hidden" name="noFirstLine" value="$ENV{'form.noFirstLine'}" />
 <input type="hidden" name="upfiletype" value="$ENV{'form.upfiletype'}" />
 <input type="hidden" name="upfile_associate" 
                                        value="$ENV{'form.upfile_associate'}" />
@@ -524,6 +525,7 @@
     &print_upload_manager_header($r,$datatoken,$distotal,$krbdefdom);
     my $i;
     my $keyfields;
+    my $dummy;
     if ($total>=0) {
 	my @d=(['username','Username'],
                ['names','Last Name, First Names'],
@@ -535,6 +537,10 @@
                ['sec','Group/Section'],
 	       ['ipwd','Initial Password'],
                ['email','EMail Address']);
+	if($ENV{'form.noFirstLine'}){
+	    ($dummy,@records)=@records;
+	}
+
 	if ($ENV{'form.upfile_associate'} eq 'reverse') {	
 	    &Apache::loncommon::csv_print_samples($r,\@records);
 	    $i=&Apache::loncommon::csv_print_select_table($r,\@records,\@d);
@@ -1528,6 +1534,7 @@
 <input type=submit name="fileupload" value="Upload Courselist">
 <input type="hidden" name="action" value="upload" />
 <input type="hidden" name="state"  value="got_file" />
+<input type="checkbox" name="noFirstLine" /> Ignore First Line<br />
 </p>
 $create_classlist_help <br />
 $create_csv_help