diff --git a/src/Resources/public/js/pimcore/configuration/item/placeSettings.js b/src/Resources/public/js/pimcore/configuration/item/placeSettings.js index d6aa97f..25589dd 100644 --- a/src/Resources/public/js/pimcore/configuration/item/placeSettings.js +++ b/src/Resources/public/js/pimcore/configuration/item/placeSettings.js @@ -168,170 +168,4 @@ pimcore.bundle.workflowDesigner.item.placeSettings = Class.create(pimcore.bundle return this.mainPanel; }, - /* - buildPermissionPanel: function() { - this.permissionPanel = Ext.create('Ext.panel.Panel', { - scrollable: true, - tbar: { - items: [ - { - text: t('add'), - iconCls: 'pimcore_icon_add', - handler: function() { - this.collapseAll(); - this.addItem({}, false, true); - }.bind(this) - }, '->', { - text: t('bundle_wfdesigner_place_permissions_collapse_all'), - iconCls: 'workflow_designer_icon_collapse', - handler: this.collapseAll.bind(this) - } - ] - }, - }); - - return this.permissionPanel; - }, - - initPermissionPanel: function(permissions) { - - permissions.forEach(function(permission) { - this.addItem(permission, true, false); - }.bind(this)); - - }, - - collapseAll: function() { - this.permissionPanel.items.items.forEach(function(item) { - item.collapse(null, false); - }); - }, - - - addItem: function(data, collapsed, scrollToBottom) { - - const item = Ext.create('Pimcore.WorkflowDesigner.StructuredValueForm', { - bodyStyle: 'padding:10px;', - collapsed : true, - collapsible: true, - titleCollapse: true, - hideCollapseTool: true, - headerOverCls: 'workflow_designer_cursor_pointer', - cls: 'workflow_designer_settings_accordion_panel', - collapsedCls: 'workflow_designer_collapsed', - defaults: { - labelWidth: 100 - }, - tools: [{ - type: 'close', - cls: 'workflow_designer_icon_settings_accordion_panel_remove', - handler: function(owner, tool, event) { - const ownerContainer = event.container.component.ownerCt; - ownerContainer.remove(event.container.component, true); - ownerContainer.updateLayout(); - }.bind(this) - }], - }); - - item.add([ - { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_place_permissions_condition'), - name: 'condition', - value: data.condition, - tooltip: t('bundle_wfdesigner_tooltip_place_permission_condition'), - width: '100%', - listeners: { - render: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners.render, - change: function(field, newValue) { - this.updatePermissionItemTitle(newValue, item); - }.bind(this) - } - },{ - xtype: 'panel', - layout: 'column', - items: [ - { - xtype: 'panel', - columnWidth: 0.5, - items: [ - this.getPermissionCheckbox('modify', data.modify), - this.getPermissionCheckbox('save', data.save), - this.getPermissionCheckbox('publish', data.publish), - this.getPermissionCheckbox('unpublish', data.unpublish), - this.getPermissionCheckbox('delete', data.delete), - ] - },{ - xtype: 'panel', - columnWidth: 0.5, - items: [ - this.getPermissionCheckbox('rename', data.rename), - this.getPermissionCheckbox('view', data.view), - this.getPermissionCheckbox('settings', data.settings), - this.getPermissionCheckbox('versions', data.versions), - this.getPermissionCheckbox('properties', data.properties), - ] - } - ] - }, - - - { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_place_permissions_object_layout'), - name: 'objectLayout', - value: data.objectLayout, - tooltip: t('bundle_wfdesigner_tooltip_place_permission_object_layout'), - listeners: { - render: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners.render, - }, - width: '100%' - }, - ]); - - this.updatePermissionItemTitle(data.condition, item); - - this.permissionPanel.add(item); - - if(collapsed) { - item.collapse(null, false); - } else { - item.expand(false); - } - - if(scrollToBottom) { - this.mainPanel.getScrollable().scrollTo(0, 9999, false); - } - }, - - getPermissionCheckbox: function (name, initValue) { - return { - xtype: 'combobox', - fieldLabel: t('bundle_wfdesigner_place_permissions_' + name), - name: name, - store: Ext.data.ArrayStore({ - fields: ['type'], - data: [ - [null, t('bundle_wfdesigner_place_permissions_nc')], - [true, t('bundle_wfdesigner_place_permissions_yes')], - [false, t('bundle_wfdesigner_place_permissions_no')] - ] - }), - value: initValue, - displayField: 'type', - valueField: 'type' - }; - }, - - updatePermissionItemTitle: function(condition, itemPanel) { - let title = t('bundle_wfdesigner_place_permissions_title'); - if(condition && condition.length > 0) { - - title = title + t('bundle_wfdesigner_place_permissions_title_for') + condition; - - } - itemPanel.setTitle(title); - } -*/ - }); \ No newline at end of file