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

banghart lon-capa-cvs@mail.lon-capa.org
Fri, 01 Dec 2006 00:26:09 -0000


banghart		Thu Nov 30 19:26:09 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  	Bug 5094. Can now upload semi-colon (;) separated values.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.479 loncom/interface/loncommon.pm:1.480
--- loncom/interface/loncommon.pm:1.479	Thu Nov 30 17:29:03 2006
+++ loncom/interface/loncommon.pm	Thu Nov 30 19:26:07 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.479 2006/11/30 22:29:03 albertel Exp $
+# $Id: loncommon.pm,v 1.480 2006/12/01 00:26:07 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5136,7 +5136,15 @@
             $i++;
         }
     } else {
-        my @allfields=split(/\,/,$record);
+        my @allfields;
+        &Apache::lonnet::logthis("file type is ".$env{'form.upfiletype'});
+        if ($env{'form.upfiletype'} eq 'semisv') {
+            &Apache::lonnet::logthis("splitting on ; ");
+            @allfields=split(/;/,$record);
+        } else {
+            &Apache::lonnet::logthis("splitting on , ");
+            @allfields=split(/\,/,$record);
+        }
         my $i=0;
         my $j;
         for ($j=0;$j<=$#allfields;$j++) {
@@ -5174,6 +5182,7 @@
 sub upfile_select_html {
     my %Types = (
                  csv   => &mt('CSV (comma separated values, spreadsheet)'),
+                 semisv => &mt('Semicolon separated values'),
                  space => &mt('Space separated'),
                  tab   => &mt('Tabulator separated'),
 #                 xml   => &mt('HTML/XML'),