Author: mcantelon
Date: Tue Jan 10 13:43:12 2012
New Revision: 10623

Log:
Added display of handled columns that doesn't correspond to an imported column.

Modified:
   trunk/lib/QubitFlatfileImport.class.php

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Tue Jan 10 13:29:32 2012        
(r10622)
+++ trunk/lib/QubitFlatfileImport.class.php     Tue Jan 10 13:43:12 2012        
(r10623)
@@ -177,18 +177,35 @@
     return $ignored;
   }
 
-  public function renderUnhandledColumns()
+  public function renderProblemColumns($columns, $problemDescription)
   {
     $output = '';
 
-    $ignored = $this->determineUnhandledColumns();
-
-    if (count($ignored))
+    if (count($columns))
     {
-      $output .= count($ignored) . " columns aren't handled or ignored:\n";
-      $output .= '  '. implode("\n  ", $ignored) ."\n"; 
+      $output .= count($columns) . " columns ". $problemDescription .":\n";
+      $output .= '  '. implode("\n  ", $columns) ."\n"; 
     }
 
+    $output .= "\n";
+
+    return $output;
+  }
+
+  public function renderUnhandledColumns()
+  {
+    return $this->renderProblemColumns(
+      $this->determineUnhandledColumns(),
+      "aren't handled or ignored"
+    );
+  }
+
+  public function renderUnmatchedColumns()
+  {
+    return $this->renderProblemColumns(
+      $this->determineUnmatchedHandledColumns(),
+      'are being handled but do not have an import column to work with'
+    );
     return $output;
   }
 
@@ -213,6 +230,10 @@
     // inform user of any columns not included in import
     print $this->renderUnhandledColumns();
 
+    // inform user of any columns that are handled, but don't match import
+    // columns
+    print $this->renderUnmatchedColumns();
+
     $this->startTimer();
 
     // import each row

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to