Bläddra i källkod

Nicer display of the CSV import results...

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@938 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 år sedan
förälder
incheckning
6cee2e525f
2 ändrade filer med 30 tillägg och 13 borttagningar
  1. 17 0
      css/light-grey.css
  2. 13 13
      pages/csvimport.php

+ 17 - 0
css/light-grey.css

@@ -869,4 +869,21 @@ div.footer{
 #SearchResultsToAdd table.listResults tbody {
 #SearchResultsToAdd table.listResults tbody {
 	height: 300px;
 	height: 300px;
 	overflow-y: auto;
 	overflow-y: auto;
+}
+tr.row_unchanged td {
+	border-bottom: 1px #ccc solid;
+	padding: 2px;
+}
+.wizContainer table tr.row_error td {
+	border-bottom: 1px #ccc solid;
+	background-color: #fdd;
+	padding: 2px;
+}
+tr.row_modified td {
+	border-bottom: 1px #ccc solid;
+	padding: 2px;
+}
+tr.row_added td {
+	border-bottom: 1px #ccc solid;
+	padding: 2px;
 }
 }

+ 13 - 13
pages/csvimport.php

@@ -338,15 +338,15 @@ try
 		$oPage->add('<input type="hidden" name="csvdata_truncated" id="csvdata_truncated" value="'.htmlentities($sCSVDataTruncated, ENT_QUOTES, 'UTF-8').'"/>');
 		$oPage->add('<input type="hidden" name="csvdata_truncated" id="csvdata_truncated" value="'.htmlentities($sCSVDataTruncated, ENT_QUOTES, 'UTF-8').'"/>');
 		$aRes = $oBulk->Process($oMyChange);
 		$aRes = $oBulk->Process($oMyChange);
 
 
-		$sHtml = '<table id="bulk_preview">';
-		$sHtml .= '<tr><th>Line</th>';
-		$sHtml .= '<th>Status</th>';
-		$sHtml .= '<th>Object</th>';
+		$sHtml = '<table id="bulk_preview" style="border-collapse: collapse;">';
+		$sHtml .= '<tr><th style="padding:2px;border-right: 2px #fff solid;">Line</th>';
+		$sHtml .= '<th style="padding:2px;border-right: 2px #fff solid;">Status</th>';
+		$sHtml .= '<th style="padding:2px;border-right: 2px #fff solid;">Object</th>';
 		foreach($aFieldsMapping as $iNumber => $sAttCode)
 		foreach($aFieldsMapping as $iNumber => $sAttCode)
 		{
 		{
 			if (!empty($sAttCode) && ($sAttCode != ':none:') && ($sAttCode != 'finalclass'))
 			if (!empty($sAttCode) && ($sAttCode != ':none:') && ($sAttCode != 'finalclass'))
 			{
 			{
-				$sHtml .= "<th>".GetFriendlyAttCodeName($sClassName, $sAttCode)."</th>";
+				$sHtml .= "<th style=\"padding:2px;border-right: 2px #fff solid;\">".GetFriendlyAttCodeName($sClassName, $sAttCode)."</th>";
 			}
 			}
 		}
 		}
 		$sHtml .= '<th>Message</th>';
 		$sHtml .= '<th>Message</th>';
@@ -413,9 +413,9 @@ try
 				break;		
 				break;		
 			}
 			}
 			$sHtml .= '<tr class="'.$sCSSRowClass.'">';
 			$sHtml .= '<tr class="'.$sCSSRowClass.'">';
-			$sHtml .= "<td>".sprintf("%0{$sMaxLen}d", 1+$iLine+$iRealSkippedLines)."</td>";
-			$sHtml .= "<td>$sStatus</td>";
-			$sHtml .= "<td>$sUrl</td>";
+			$sHtml .= "<td style=\"background-color:#f1f1f1;border-right:2px #fff solid;\">".sprintf("%0{$sMaxLen}d", 1+$iLine+$iRealSkippedLines)."</td>";
+			$sHtml .= "<td style=\"text-align:center;background-color:#f1f1f1;border-right:2px #fff solid;\">$sStatus</td>";
+			$sHtml .= "<td style=\"text-align:center;background-color:#f1f1f1;\">$sUrl</td>";
 			foreach($aFieldsMapping as $iNumber => $sAttCode)
 			foreach($aFieldsMapping as $iNumber => $sAttCode)
 			{
 			{
 				if (!empty($sAttCode) && ($sAttCode != ':none:') && ($sAttCode != 'finalclass'))
 				if (!empty($sAttCode) && ($sAttCode != ':none:') && ($sAttCode != 'finalclass'))
@@ -446,7 +446,7 @@ try
 					{
 					{
 						case 'CellStatus_Issue':
 						case 'CellStatus_Issue':
 						$sCellMessage .= $oPage->GetP($oCellStatus->GetDescription());
 						$sCellMessage .= $oPage->GetP($oCellStatus->GetDescription());
-						$sHtml .= '<td class="cell_error">ERROR: '.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').$sCellMessage.'</td>';
+						$sHtml .= '<td class="cell_error" style="border-right:1px #eee solid;">ERROR: '.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').$sCellMessage.'</td>';
 						break;
 						break;
 						
 						
 						case 'CellStatus_SearchIssue':
 						case 'CellStatus_SearchIssue':
@@ -456,19 +456,19 @@ try
 						
 						
 						case 'CellStatus_Ambiguous':
 						case 'CellStatus_Ambiguous':
 						$sCellMessage .= $oPage->GetP($oCellStatus->GetDescription());
 						$sCellMessage .= $oPage->GetP($oCellStatus->GetDescription());
-						$sHtml .= '<td class="cell_error">AMBIGUOUS: '.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').$sCellMessage.'</td>';
+						$sHtml .= '<td class="cell_error" style="border-right:1px #eee solid;">AMBIGUOUS: '.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').$sCellMessage.'</td>';
 						break;
 						break;
 						
 						
 						case 'CellStatus_Modify':
 						case 'CellStatus_Modify':
-						$sHtml .= '<td class="cell_modified"><b>'.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').'</b></td>';
+						$sHtml .= '<td class="cell_modified" style="border-right:1px #eee solid;"><b>'.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').'</b></td>';
 						break;
 						break;
 						
 						
 						default:
 						default:
-						$sHtml .= '<td class="cell_ok">'.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').$sCellMessage.'</td>';
+						$sHtml .= '<td class="cell_ok" style="border-right:1px #eee solid;">'.htmlentities($aData[$iLine][$iNumber-1], ENT_QUOTES, 'UTF-8').$sCellMessage.'</td>';
 					}
 					}
 				}
 				}
 			}
 			}
-			$sHtml .= "<td class=\"$sCSSMessageClass\">$sMessage</td>";
+			$sHtml .= "<td class=\"$sCSSMessageClass\" style=\"background-color:#f1f1f1;\">$sMessage</td>";
 			$iLine++;
 			$iLine++;
 			$sHtml .= '</tr>';
 			$sHtml .= '</tr>';
 		}
 		}