diff --git a/Element/QueryBuilderElement.php b/Element/QueryBuilderElement.php index 6cc7d86..8f5d305 100644 --- a/Element/QueryBuilderElement.php +++ b/Element/QueryBuilderElement.php @@ -57,10 +57,8 @@ public static function getDefaultConfiguration() return array( 'source' => 'default', 'allowRemove' => false, - 'allowEdit' => false, 'allowExecute' => true, 'allowSave' => false, - 'allowCreate' => false, 'allowExport' => true, 'allowHtmlExport' => true, 'allowSearch' => false, @@ -115,6 +113,11 @@ public function getAssets() ), 'js' => array( '@MapbenderQueryBuilderBundle/Resources/public/queryBuilder.element.js', + '../../vendor/mapbender/vis-ui.js/src/js/jquery.form.generator.js', + '../../vendor/mapbender/vis-ui.js/src/js/utils/fn.formData.js', + '../../vendor/mapbender/vis-ui.js/src/js/elements/date.selector.js', // only for legacy browsers + '../../vendor/mapbender/vis-ui.js/src/js/elements/popup.dialog.js', + '../../vendor/mapbender/vis-ui.js/src/js/elements/data.result-table.js', ), 'trans' => array( 'MapbenderQueryBuilderBundle:Element:queryBuilder.json.twig', @@ -216,7 +219,7 @@ public function handleHttpRequest(Request $requestService) break; case 'save': - if (!$configuration['allowCreate'] && !$configuration['allowSave']) { + if (!$configuration['allowSave']) { throw new AccessDeniedHttpException(); } $dataStore = $this->getDataStore($configuration['source']); diff --git a/Element/Type/QueryBuilderAdminType.php b/Element/Type/QueryBuilderAdminType.php index 29cbb2b..d7b48c4 100644 --- a/Element/Type/QueryBuilderAdminType.php +++ b/Element/Type/QueryBuilderAdminType.php @@ -38,16 +38,12 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->add('source', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array( 'choices' => $dataStoreSelectValues, 'required' => true, - 'empty_value' => null ) ) ->add('sqlFieldName', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('required' => true)) ->add('orderByFieldName', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('required' => true)) ->add('titleFieldName', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('required' => true)) ->add('connectionFieldName', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('required' => true)) - - ->add('allowCreate', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', array('required' => false)) - ->add('allowEdit', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', array('required' => false)) ->add('allowSave', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', array('required' => false)) ->add('allowRemove', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', array('required' => false)) ->add('allowExecute', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', array('required' => false)) diff --git a/Resources/config/applications.yml b/Resources/config/applications.yml index 87899d1..ef2ec0d 100644 --- a/Resources/config/applications.yml +++ b/Resources/config/applications.yml @@ -60,12 +60,6 @@ parameters: title: SQL Queries class: Mapbender\DataSourceBundle\Element\QueryBuilderElement - # Allow edit - allowEdit: true - - # Allow edit - allowCreate: false - # Allow save allowSave: true diff --git a/Resources/public/queryBuilder.element.js b/Resources/public/queryBuilder.element.js index 2131a89..67b70cf 100644 --- a/Resources/public/queryBuilder.element.js +++ b/Resources/public/queryBuilder.element.js @@ -206,76 +206,6 @@ }); }, - /** - * Open SQL edit dialog - * - * @param item - */ - openEditDialog: function(item) { - var widget = this; - var config = widget.options; - var buttons = []; - - config.allowSave && buttons.push(widget.saveButton); - config.allowExecute && buttons.push(widget.executeButton); - config.allowExport && buttons.push(widget.exportButton); - config.allowExport && buttons.push(widget.exportHtmlButton); - config.allowRemove && buttons.push(widget.removeButton); - - buttons.push(widget.closeButton); - - var $form = $("