BUG 6588 Problems importing a process that has Report Tables

Fixed an issue whe a process is imported with Report Tables when there are duplicate fields
This commit is contained in:
Hugo Loza
2011-04-01 18:00:09 -04:00
parent 3d46ebae6d
commit aab27bfaaf
2 changed files with 60 additions and 52 deletions

View File

@@ -1577,10 +1577,15 @@ class Processes {
$oData->reportTables[$key]['REP_TAB_UID'] = $newGuid; $oData->reportTables[$key]['REP_TAB_UID'] = $newGuid;
} }
foreach ( $oData->reportTablesVars as $key => $val ) { foreach ( $oData->reportTablesVars as $key => $val ) {
if(isset($map[ $val['REP_TAB_UID'] ])){
/*TODO: Why this can be not defined?? The scenario was when
* imported an existing process but as a new one
*/
$newGuid = $map[ $val['REP_TAB_UID'] ]; $newGuid = $map[ $val['REP_TAB_UID'] ];
$oData->reportTablesVars[$key]['REP_TAB_UID'] = $newGuid; $oData->reportTablesVars[$key]['REP_TAB_UID'] = $newGuid;
} }
} }
}
/** /**
* Renew all the GUID's for All The Report Vars Objects * Renew all the GUID's for All The Report Vars Objects
@@ -2146,7 +2151,7 @@ class Processes {
if( $oContent->Exists($ConCategory, $ConParent, $ConId, $ConLang) ) { if( $oContent->Exists($ConCategory, $ConParent, $ConId, $ConLang) ) {
$oContent->removeContent($ConCategory, $ConParent, $ConId); $oContent->removeContent($ConCategory, $ConParent, $ConId);
} }
$oContent->addContent($ConCategory, $ConParent, $ConId, $ConLang); $oContent->addContent($ConCategory, $ConParent, $ConId, $ConLang,"");
} }
} #@!neyek } #@!neyek

View File

@@ -391,11 +391,14 @@ class ReportTables
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next(); $oDataset->next();
$aVars = array(); $aVars = array();
$aImportedVars = array();//This array will help to control if the variable already exist
while ($aRow = $oDataset->getRow()) { while ($aRow = $oDataset->getRow()) {
if ($bWhitType) { if ($bWhitType) {
if(in_array($aRow['REP_VAR_NAME'],$aImportedVars)){
$aImportedVars[]=$aRow['REP_VAR_NAME'];
$aVars[] = array('sFieldName' => $aRow['REP_VAR_NAME'], 'sType' => $aRow['REP_VAR_TYPE']); $aVars[] = array('sFieldName' => $aRow['REP_VAR_NAME'], 'sType' => $aRow['REP_VAR_TYPE']);
} }
else { }else {
$aVars[] = $aRow['REP_VAR_NAME']; $aVars[] = $aRow['REP_VAR_NAME'];
} }
$oDataset->next(); $oDataset->next();