From e3b14d2463b35e33ba48a77d403cf7a659671943 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 17 Dec 2018 16:58:16 +0100 Subject: [PATCH] #131 remove field configuration for classification store in getter -> this comes directly from the controller --- .../Controller/ExportDefinitionController.php | 7 +------ .../Controller/ImportDefinitionController.php | 7 +------ .../pimcore/js/getters/classificationstore.js | 13 ++----------- .../pimcore/js/setters/classificationstore.js | 13 ++----------- 4 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/ImportDefinitionsBundle/Controller/ExportDefinitionController.php b/src/ImportDefinitionsBundle/Controller/ExportDefinitionController.php index 807a43cb..794734f3 100644 --- a/src/ImportDefinitionsBundle/Controller/ExportDefinitionController.php +++ b/src/ImportDefinitionsBundle/Controller/ExportDefinitionController.php @@ -233,10 +233,6 @@ public function getColumnsAction(Request $request) * @var DataObject\Classificationstore\GroupConfig $config */ foreach ($groupConfigList as $config) { - if (in_array($config->getId(), $csLoadedGroupIds)) { - continue; - } - foreach ($config->getRelations() as $relation) { if ($relation instanceof DataObject\Classificationstore\KeyGroupRelation) { $keyId = $relation->getKeyId(); @@ -250,6 +246,7 @@ public function getColumnsAction(Request $request) $toColumn->setFieldtype($keyConfig->getType()); $toColumn->setGetter('classificationstore'); $toColumn->setConfig([ + 'field' => $field->getName(), 'keyId' => $keyConfig->getId(), 'groupId' => $config->getId(), ]); @@ -259,8 +256,6 @@ public function getColumnsAction(Request $request) $result[] = $toColumn; } } - - $csLoadedGroupIds[] = $config->getId(); } break; diff --git a/src/ImportDefinitionsBundle/Controller/ImportDefinitionController.php b/src/ImportDefinitionsBundle/Controller/ImportDefinitionController.php index a30b7ac0..062536b4 100644 --- a/src/ImportDefinitionsBundle/Controller/ImportDefinitionController.php +++ b/src/ImportDefinitionsBundle/Controller/ImportDefinitionController.php @@ -348,10 +348,6 @@ public function getClassDefinitionForFieldSelection(DataObject\ClassDefinition $ * @var DataObject\Classificationstore\GroupConfig $config */ foreach ($groupConfigList as $config) { - if (in_array($config->getId(), $csLoadedGroupIds)) { - continue; - } - foreach ($config->getRelations() as $relation) { if ($relation instanceof DataObject\Classificationstore\KeyGroupRelation) { $keyId = $relation->getKeyId(); @@ -365,6 +361,7 @@ public function getClassDefinitionForFieldSelection(DataObject\ClassDefinition $ $toColumn->setFieldtype($keyConfig->getType()); $toColumn->setSetter('classificationstore'); $toColumn->setConfig([ + 'field' => $field->getName(), 'keyId' => $keyConfig->getId(), 'groupId' => $config->getId(), ]); @@ -373,8 +370,6 @@ public function getClassDefinitionForFieldSelection(DataObject\ClassDefinition $ $result[] = $toColumn; } } - - $csLoadedGroupIds[] = $config->getId(); } } else { $result[] = $this->getFieldConfiguration($field); diff --git a/src/ImportDefinitionsBundle/Resources/public/pimcore/js/getters/classificationstore.js b/src/ImportDefinitionsBundle/Resources/public/pimcore/js/getters/classificationstore.js index 404361e5..527f19c5 100644 --- a/src/ImportDefinitionsBundle/Resources/public/pimcore/js/getters/classificationstore.js +++ b/src/ImportDefinitionsBundle/Resources/public/pimcore/js/getters/classificationstore.js @@ -17,23 +17,14 @@ pimcore.plugin.importdefinitions.getters.classificationstore = Class.create(pimc getLayout : function (fromColumn, toColumn, record, config) { this.fromColumn = fromColumn; - this.classificationStoreField = Ext.create({ - xtype : 'textfield', - fieldLabel : t('field'), - name : 'field', - length : 255, - allowBlank: false, - value : config.field ? config.field : null - }); - - return [this.classificationStoreField]; + return []; }, getGetterData: function () { return { 'keyConfig': this.fromColumn.config.keyId, 'groupConfig': this.fromColumn.config.groupId, - 'field': this.classificationStoreField.getValue() + 'field': this.fromColumn.config.field }; } }); diff --git a/src/ImportDefinitionsBundle/Resources/public/pimcore/js/setters/classificationstore.js b/src/ImportDefinitionsBundle/Resources/public/pimcore/js/setters/classificationstore.js index d726abdf..e5823663 100644 --- a/src/ImportDefinitionsBundle/Resources/public/pimcore/js/setters/classificationstore.js +++ b/src/ImportDefinitionsBundle/Resources/public/pimcore/js/setters/classificationstore.js @@ -17,23 +17,14 @@ pimcore.plugin.importdefinitions.setters.classificationstore = Class.create(pimc getLayout : function (fromColumn, toColumn, record, config) { this.toColumn = toColumn; - this.classificationStoreField = Ext.create({ - xtype : 'textfield', - fieldLabel : t('field'), - name : 'field', - length : 255, - allowBlank: false, - value : config.field ? config.field : null - }); - - return [this.classificationStoreField]; + return []; }, getSetterData: function () { return { 'keyConfig': this.toColumn.data.config.keyId, 'groupConfig': this.toColumn.data.config.groupId, - 'field': this.classificationStoreField.getValue() + 'field': this.toColumn.data.config.field }; } });