Ejemplo n.º 1
0
 protected function makeImportCompleteView(Import $import, ImportWizardForm $importWizardForm, ImportDataProvider $dataProvider, $setCurrentPageToFirst = false, $pageSize = null)
 {
     if ($pageSize == null) {
         $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('listPageSize');
     }
     $config = array('pagination' => array('pageSize' => $pageSize));
     $unserializedData = unserialize($import->serializedData);
     $importCompleteView = new ImportWizardCreateUpdateModelsCompleteView($this->getId(), $this->getModule()->getId(), $importWizardForm, $dataProvider, $unserializedData['mappingData'], (int) ImportRowDataResultsUtil::getCreatedCount($import->getTempTableName()), (int) ImportRowDataResultsUtil::getUpdatedCount($import->getTempTableName()), (int) ImportRowDataResultsUtil::getErrorCount($import->getTempTableName()));
     return $importCompleteView;
 }
Ejemplo n.º 2
0
 protected function makeImportCompleteView(Import $import, ImportWizardForm $importWizardForm, $setCurrentPageToFirst = false)
 {
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('listPageSize');
     $config = array('pagination' => array('pageSize' => $pageSize));
     if ($setCurrentPageToFirst) {
         $config['pagination']['currentPage'] = 0;
     }
     $importErrorsDataProvider = new ImportDataProvider($import->getTempTableName(), (bool) $importWizardForm->firstRowIsHeaderRow, $config, ImportRowDataResultsUtil::ERROR);
     $errorListView = new ImportErrorsListView($this->getId(), $this->getModule()->getId(), 'NotUsed', $importErrorsDataProvider);
     $importCompleteView = new ImportWizardCreateUpdateModelsCompleteView($this->getId(), $this->getModule()->getId(), $importWizardForm, (int) ImportRowDataResultsUtil::getCreatedCount($import->getTempTableName()), (int) ImportRowDataResultsUtil::getUpdatedCount($import->getTempTableName()), (int) ImportRowDataResultsUtil::getErrorCount($import->getTempTableName()), $errorListView);
     return $importCompleteView;
 }