Browse Source

Fixed an issue in the display of CSV imports history

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1013 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 years ago
parent
commit
5bc28d3834
1 changed files with 6 additions and 4 deletions
  1. 6 4
      core/bulkchange.class.inc.php

+ 6 - 4
core/bulkchange.class.inc.php

@@ -840,10 +840,11 @@ class BulkChange
 			$oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $oChange->GetKey()));
 			$oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $oChange->GetKey()));
 			$iCreated = $oOpSet->Count();
 			$iCreated = $oOpSet->Count();
 
 
-			//while ($oCreated = $oOpSet->Fetch())
-			//{
-			//	$oPage->p("Created ".$oCreated->Get('objclass')."::".$oCreated->Get('objkey'));
-			//}
+			// Get the class from the first item found (assumption: a CSV load is done for a single class)
+			if ($oCreateOp = $oOpSet->Fetch())
+			{
+				$sClass = $oCreateOp->Get('objclass');
+			}
 
 
 			$oOpSearch = DBObjectSearch::FromOQL("SELECT CMDBChangeOpSetAttribute WHERE change = :change_id");
 			$oOpSearch = DBObjectSearch::FromOQL("SELECT CMDBChangeOpSetAttribute WHERE change = :change_id");
 			$oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $oChange->GetKey()));
 			$oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $oChange->GetKey()));
@@ -852,6 +853,7 @@ class BulkChange
 			$aAttList = array();
 			$aAttList = array();
 			while ($oModified = $oOpSet->Fetch())
 			while ($oModified = $oOpSet->Fetch())
 			{
 			{
+				// Get the class (if not done earlier on object creation)
 				$sClass = $oModified->Get('objclass');
 				$sClass = $oModified->Get('objclass');
 				$iKey = $oModified->Get('objkey');
 				$iKey = $oModified->Get('objkey');
 				$sAttCode = $oModified->Get('attcode');
 				$sAttCode = $oModified->Get('attcode');