removes some unused files from Mailfiler
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Jun 2017 06:45:19 +0000 (08:45 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Jun 2017 07:46:12 +0000 (09:46 +0200)
* Download Link stuff

Change-Id: I9b4447b8b5c099c865689d17f32ffba9280ac08b
Reviewed-on: http://gerrit.tine20.com/customers/4864
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/MailFiler/MailFiler.jsb2
tine20/MailFiler/js/DownloadLinkDialog.js [deleted file]
tine20/MailFiler/js/DownloadLinkGridPanel.js [deleted file]

index 4d3e276..e7ae87f 100644 (file)
           "path": "js/"
         },
         {
-          "text": "DownloadLinkDialog.js",
-          "path": "js/"
-        },
-        {
-          "text": "DownloadLinkGridPanel.js",
-          "path": "js/"
-        },
-        {
           "text": "MailFiler.js",
           "path": "js/"
         }
diff --git a/tine20/MailFiler/js/DownloadLinkDialog.js b/tine20/MailFiler/js/DownloadLinkDialog.js
deleted file mode 100644 (file)
index 7cc6e6b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Tine 2.0
- * 
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schüle <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2014 Metaways Infosystems GmbH (http://www.metaways.de)
- * 
- * TODO         maybe we don't need this
- */
-Ext.ns('Tine.MailFiler');
-
-/**
- * @namespace   Tine.MailFiler
- * @class       Tine.MailFiler.DownloadLinkDialog
- * @extends     Tine.widgets.dialog.EditDialog
- * 
- * <p>Sieve Filter Dialog</p>
- * <p>This dialog is for editing sieve filters (rules).</p>
- * <p>
- * </p>
- * 
- * @author      Philipp Schüle <p.schuele@metaways.de>
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * 
- * @param       {Object} config
- * @constructor
- * Create a new RulesDialog
- */
-Tine.MailFiler.DownloadLinkDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
-
-    /**
-     * @cfg {Tine.Felamimail.Model.Account}
-     * 
-     * TODO use node record?
-     */
-    node: null,
-
-    /**
-     * @private
-     */
-    windowNamePrefix: 'DownloadLinkWindow_',
-    appName: 'MailFiler',
-//    loadRecord: false,
-    mode: 'local',
-    tbarItems: [],
-    evalGrants: false,
-    
-    //private
-    initComponent: function(){
-        Tine.MailFiler.DownloadLinkDialog.superclass.initComponent.call(this);
-        
-        this.i18nRecordName = this.app.i18n._('Node Download Links');
-    },
-    
-    /**
-     * overwrite update toolbars function (we don't have record grants yet)
-     * 
-     * @private
-     */
-    updateToolbars: Ext.emptyFn,
-    
-    /**
-     * init record to edit
-     * -> we don't have a real record here
-     */
-    initRecord: function() {
-//        this.onRecordLoad();
-    },
-    
-    /**
-     * executed after record got updated from proxy
-     * -> we don't have a real record here
-     * 
-     * @private
-     */
-    onRecordLoad: function() {
-    },
-        
-    /**
-     * returns dialog
-     * 
-     * NOTE: when this method gets called, all initalisation is done.
-     * 
-     * @return {Object}
-     * @private
-     * 
-     */
-    getFormItems: function() {
-        this.linkGrid = new Tine.MailFiler.DownloadLinkGridPanel({
-            //account: this.account
-        });
-        
-        return [this.linkGrid];
-    }
-});
-
-/**
- * DownloadLink Edit Popup
- * 
- * @param   {Object} config
- * @return  {Ext.ux.Window}
- */
-Tine.MailFiler.DownloadLinkDialog.openWindow = function (config) {
-    var window = Tine.WindowFactory.getWindow({
-        width: 800,
-        height: 400,
-        name: Tine.MailFiler.DownloadLinkDialog.prototype.windowNamePrefix + Ext.id(),
-        contentPanelConstructor: 'Tine.MailFiler.DownloadLinkDialog',
-        contentPanelConstructorConfig: config
-    });
-    return window;
-};
diff --git a/tine20/MailFiler/js/DownloadLinkGridPanel.js b/tine20/MailFiler/js/DownloadLinkGridPanel.js
deleted file mode 100644 (file)
index 5f05a81..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Tine 2.0
- * 
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schüle <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2014 Metaways Infosystems GmbH (http://www.metaways.de)
- */
-Ext.ns('Tine.MailFiler');
-
-/**
- * File grid panel
- * 
- * @namespace   Tine.MailFiler
- * @class       Tine.MailFiler.DownloadLinkGridPanel
- * @extends     Tine.widgets.grid.GridPanel
- * 
- * <p>DownloadLink Grid Panel</p>
- * <p><pre>
- * </pre></p>
- * 
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schüle <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2014 Metaways Infosystems GmbH (http://www.metaways.de)
- * 
- * @param       {Object} config
- * @constructor
- * Create a new Tine.MailFiler.FileGridPanel
- */
-Tine.MailFiler.DownloadLinkGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
-    /* config */
-    frame: true,
-    border: true,
-    autoScroll: true,
-    layout: 'fit',
-    autoExpandColumn: 'url',
-    
-    enableHdMenu: false,
-    /**
-     * inits this cmp
-     * @private
-     */
-    initComponent: function() {
-        this.recordProxy = Tine.MailFiler.downloadLinkRecordBackend;
-        this.recordClass = Tine.MailFiler.Model.DownloadLink;
-        
-        this.store = new Ext.data.Store({
-            fields: this.recordClass,
-            proxy: this.recordProxy,
-            reader: this.recordProxy.getReader(),
-            remoteSort: false,
-            sortInfo: {
-                field: 'expiry_time',
-                direction: 'DESC'
-            },
-            listeners: {
-                scope: this,
-                'beforeload': this.onStoreBeforeload,
-                'update': this.onStoreUpdate
-            }
-        });
-        
-        this.actionCreate = new Ext.Action({
-            text: this.app.i18n._('Create Public Link'),
-            disabled: false,
-            scope: this,
-            handler: this.onCreate,
-            iconCls: 'action_add'
-        });
-        
-        this.actionRemove = new Ext.Action({
-            text: i18n._('Remove record'),
-            disabled: true,
-            scope: this,
-            handler: this.onRemove,
-            iconCls: 'action_delete'
-        });
-        
-        this.tbar = [
-            this.actionCreate,
-            this.actionRemove
-        ];
-        
-        this.contextMenu = new Ext.menu.Menu({
-            plugins: [{
-                ptype: 'ux.itemregistry',
-                key:   'Tinebase-MainContextMenu'
-            }],
-            items: [
-                this.actionCreate,
-                this.actionRemove
-            ]
-        });
-        
-        this.cm = this.getColumnModel();
-        this.sm = new Ext.grid.RowSelectionModel({multiSelect:true});
-
-        this.plugins = this.plugins ? this.plugins : [];
-        this.plugins.push(new Ext.ux.grid.GridViewMenuPlugin({}));
-        this.stripeRows = Tine.Tinebase.registry.get('preferences').get('gridStripeRows')
-            ? Tine.Tinebase.registry.get('preferences').get('gridStripeRows')
-            : false,
-        
-        // on selectionchange handler
-        this.sm.on('selectionchange', function(sm) {
-            var rowCount = sm.getCount();
-            this.actionRemove.setDisabled(rowCount == 0);
-        }, this);
-        
-        // on rowcontextmenu handler
-        this.on('rowcontextmenu', this.onRowContextMenu.createDelegate(this), this);
-        
-        Tine.MailFiler.DownloadLinkGridPanel.superclass.initComponent.call(this);
-        
-        this.initialLoad();
-    },
-    
-    /**
-     * that's the context menu handler
-     * @param {} grid
-     * @param {} row
-     * @param {} e
-     */
-    onRowContextMenu: function(grid, row, e) {
-        e.stopEvent();
-        
-        this.fireEvent('beforecontextmenu', grid, row, e);
-        
-        var sm = grid.getSelectionModel();
-        if (!sm.isSelected(row)) {
-            sm.selectRow(row);
-        }
-        
-        this.contextMenu.showAt(e.getXY());
-    },
-    
-    onCreate: function() {
-        if (! this.createMask) {
-            this.createMask = new Ext.LoadMask(this.getEl(), {
-                msg: this.app.i18n._('Creating new Download Link...')
-            });
-        }
-        this.createMask.show();
-        
-        var date = new Date();
-        date.setDate(date.getDate() + 30);
-        
-        var record = new this.recordClass({node_id: this.editDialog.record.get('id'), expiry_time: date});
-        this.recordProxy.saveRecord(record, {success: this.onAfterCreate, scope: this});
-    },
-    
-    onAfterCreate: function() {
-        this.store.load();
-        this.createMask.hide();
-    },
-    
-    onAfterDelete: function() {
-        this.store.load();
-        this.deleteMask.hide();
-    },
-    
-    /**
-     * remove handler
-     * 
-     * @param {} button
-     * @param {} event
-     */
-    onRemove: function(button, event) {
-        
-        var selectedRows = this.getSelectionModel().getSelections();
-        
-        if (selectedRows.length == 0) {
-            return;
-        }
-        
-        if (! this.deleteMask) {
-            this.deleteMask = new Ext.LoadMask(this.getEl(), {
-                msg: selectedRows.length > 1 ? this.app.i18n._('Deleting Download Links...') : this.app.i18n._('Deleting Download Link...')
-            });
-        }
-        
-        this.deleteMask.show();
-        
-        this.recordProxy.deleteRecords(selectedRows, {success: this.onAfterDelete, scope: this});
-    },
-    
-    /**
-     * called before store queries for data
-     */
-    onStoreBeforeload: function(store, options) {
-        options.params = options.params || {};
-        // allways start with an empty filter set!
-        // this is important for paging and sort header!
-        options.params.filter = [{field: 'node_id', operator: 'in', value: this.editDialog.record.get('id') }];
-    },
-    
-    /**
-     * called when the store gets updated, e.g. from editgrid
-     * 
-     * @param {Ext.data.store} store
-     * @param {Tine.Tinebase.data.Record} record
-     * @param {String} operation
-     */
-    onStoreUpdate: function(store, record, operation) {
-        switch (operation) {
-            case Ext.data.Record.EDIT:
-                // don't save these records. Add them to the parents' record store
-                this.recordProxy.saveRecord(record, {
-                    scope: this,
-                    success: function(updatedRecord) {
-                        store.commitChanges();
-
-                        // update record in store to prevent concurrency problems
-                        record.data = updatedRecord.data;
-                    }
-                });
-                break;
-            case Ext.data.Record.COMMIT:
-                //nothing to do, as we need to reload the store anyway.
-                break;
-        }
-    },
-    
-    /**
-     * returns cm
-     * 
-     * @return Ext.grid.ColumnModel
-     * @private
-     * 
-     * TODO    add more columns
-     */
-    getColumnModel: function(){
-        var columns = [{ 
-                id: 'url',
-                header: this.app.i18n._('Url'),
-                dataIndex: 'url',
-                width: 250,
-                //sortable: false,
-                hidden: false,
-                editor: new Ext.form.Field({
-                    listeners: {
-                        change: function() {
-                            this.setValue(this.startValue);
-                        }
-                    }
-                }),
-                readOnly: true,
-                disabled: true
-            }, {
-                id: 'created_by',
-                header: this.app.i18n._("Created By"),
-                width: 150,
-                sortable: true,
-                dataIndex: 'created_by',
-                hidden: false,
-                renderer: Tine.Tinebase.common.usernameRenderer
-            }, {
-                id: 'creation_time',
-                header: this.app.i18n._("Creation Time"),
-                width: 100,
-                sortable: true,
-                dataIndex: 'creation_time',
-                renderer: Tine.Tinebase.common.dateTimeRenderer,
-                hidden: true
-            }, {
-                id: 'expiry_time',
-                header: this.app.i18n._("Expiration Time"),
-                width: 100,
-                sortable: true,
-                dataIndex: 'expiry_time',
-                hidden: false,
-                renderer: Tine.Tinebase.common.dateTimeRenderer,
-                editor: new Ext.ux.form.ClearableDateField()
-            }, {
-                id: 'access_count',
-                header: this.app.i18n._("Access Count"),
-                width: 70,
-                sortable: true,
-                dataIndex: 'access_count',
-                hidden: false
-            }, {
-                id: 'last_modified_time',
-                header: this.app.i18n._("Last Modified Time"),
-                width: 100,
-                sortable: true,
-                dataIndex: 'last_modified_time',
-                hidden: true,
-                renderer: Tine.Tinebase.common.dateTimeRenderer
-            }, {
-                id: 'last_modified_by',
-                header: this.app.i18n._("Last Modified By"),
-                width: 150,
-                sortable: true,
-                dataIndex: 'last_modified_by',
-                hidden: true,
-                renderer: Tine.Tinebase.common.usernameRenderer 
-            }
-        ];
-        
-        return new Ext.grid.ColumnModel({
-            defaults: {
-                sortable: true,
-                resizable: true
-            },
-            columns: columns
-        });
-    },
-    
-    /**
-     * preform the initial load of grid data
-     */
-    initialLoad: function() {
-        this.store.load.defer(10, this.store);
-    }
-});