Added Translation
This commit is contained in:
56
js/ABOUT.js
56
js/ABOUT.js
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ABOUT.js zarafa calender to ics im/exporter
|
||||
* ABOUT.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -19,7 +19,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter');
|
||||
|
||||
/**
|
||||
@@ -29,38 +29,38 @@ Ext.namespace('Zarafa.plugins.calendarimporter');
|
||||
* The copyright string holding the copyright notice for the Zarafa calendarimporter Plugin.
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.ABOUT = ""
|
||||
+ "<p>Copyright (C) 2012-2016 Christoph Haas <christoph.h@sprinternet.at></p>"
|
||||
+ "<p>Copyright (C) 2012-2016 Christoph Haas <christoph.h@sprinternet.at></p>"
|
||||
|
||||
+ "<p>This program is free software; you can redistribute it and/or "
|
||||
+ "modify it under the terms of the GNU Lesser General Public "
|
||||
+ "License as published by the Free Software Foundation; either "
|
||||
+ "version 2.1 of the License, or (at your option) any later version.</p>"
|
||||
+ "<p>This program is free software; you can redistribute it and/or "
|
||||
+ "modify it under the terms of the GNU Lesser General Public "
|
||||
+ "License as published by the Free Software Foundation; either "
|
||||
+ "version 2.1 of the License, or (at your option) any later version.</p>"
|
||||
|
||||
+ "<p>This program is distributed in the hope that it will be useful, "
|
||||
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of "
|
||||
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
|
||||
+ "Lesser General Public License for more details.</p>"
|
||||
+ "<p>This program is distributed in the hope that it will be useful, "
|
||||
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of "
|
||||
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
|
||||
+ "Lesser General Public License for more details.</p>"
|
||||
|
||||
+ "<p>You should have received a copy of the GNU Lesser General Public "
|
||||
+ "License along with this program; if not, write to the Free Software "
|
||||
+ "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>"
|
||||
+ "<p>You should have received a copy of the GNU Lesser General Public "
|
||||
+ "License along with this program; if not, write to the Free Software "
|
||||
+ "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>"
|
||||
|
||||
+ "<hr />"
|
||||
+ "<hr />"
|
||||
|
||||
+ "<p>The calendarimporter plugin contains the following third-party components:</p>"
|
||||
|
||||
+ "<h1>iCalcreator v2.16.12</h1>"
|
||||
+ "<p>The calendarimporter plugin contains the following third-party components:</p>"
|
||||
|
||||
+ "<p>Copyright 2007-2013 Kjell-Inge Gustafsson kigkonsult</p>"
|
||||
+ "<h1>iCalcreator v2.16.12</h1>"
|
||||
|
||||
+ "<p>This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.</p>"
|
||||
|
||||
+ "<p>This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</p>"
|
||||
|
||||
+ "<h1>Ics-parser</h1>"
|
||||
+ "<p>Copyright 2007-2013 Kjell-Inge Gustafsson kigkonsult</p>"
|
||||
|
||||
+ "<p>Copyright 2002-2007 Martin Thoma <info@martin-thoma.de></p>"
|
||||
+ "<p>This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.</p>"
|
||||
|
||||
+ "<p>Licensed under the MIT License.</p>"
|
||||
|
||||
+ "<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>";
|
||||
+ "<p>This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</p>"
|
||||
|
||||
+ "<h1>Ics-parser</h1>"
|
||||
|
||||
+ "<p>Copyright 2002-2007 Martin Thoma <info@martin-thoma.de></p>"
|
||||
|
||||
+ "<p>Licensed under the MIT License.</p>"
|
||||
|
||||
+ "<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>";
|
@@ -34,96 +34,96 @@ Ext.namespace('Zarafa.plugins.calendarimporter.data');
|
||||
* @singleton
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.data.Actions = {
|
||||
/**
|
||||
* Callback for the export request.
|
||||
* @param {Object} response
|
||||
*/
|
||||
downloadICS: function (response) {
|
||||
if (response.status == false) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title : dgettext('plugin_files', 'Warning'),
|
||||
msg : dgettext('plugin_files', response.message),
|
||||
icon : Zarafa.common.dialogs.MessageBox.WARNING,
|
||||
buttons: Zarafa.common.dialogs.MessageBox.OK
|
||||
});
|
||||
} else {
|
||||
var downloadFrame = Ext.getBody().createChild({
|
||||
tag: 'iframe',
|
||||
cls: 'x-hidden'
|
||||
});
|
||||
/**
|
||||
* Callback for the export request.
|
||||
* @param {Object} response
|
||||
*/
|
||||
downloadICS: function (response) {
|
||||
if (response.status == false) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_calendarimporter', 'Warning'),
|
||||
msg: response.message,
|
||||
icon: Zarafa.common.dialogs.MessageBox.WARNING,
|
||||
buttons: Zarafa.common.dialogs.MessageBox.OK
|
||||
});
|
||||
} else {
|
||||
var downloadFrame = Ext.getBody().createChild({
|
||||
tag: 'iframe',
|
||||
cls: 'x-hidden'
|
||||
});
|
||||
|
||||
var url = document.URL;
|
||||
var link = url.substring(0, url.lastIndexOf('/') + 1);
|
||||
var url = document.URL;
|
||||
var link = url.substring(0, url.lastIndexOf('/') + 1);
|
||||
|
||||
link += "index.php?sessionid=" + container.getUser().getSessionId() + "&load=custom&name=download_ics";
|
||||
link = Ext.urlAppend(link, "token=" + encodeURIComponent(response.download_token));
|
||||
link = Ext.urlAppend(link, "filename=" + encodeURIComponent(response.filename));
|
||||
link += "index.php?sessionid=" + container.getUser().getSessionId() + "&load=custom&name=download_ics";
|
||||
link = Ext.urlAppend(link, "token=" + encodeURIComponent(response.download_token));
|
||||
link = Ext.urlAppend(link, "filename=" + encodeURIComponent(response.filename));
|
||||
|
||||
downloadFrame.dom.contentWindow.location = link;
|
||||
}
|
||||
},
|
||||
downloadFrame.dom.contentWindow.location = link;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get all calendar folders.
|
||||
* @param {boolean} asDropdownStore If true, a simple array store will be returned.
|
||||
* @returns {*}
|
||||
*/
|
||||
getAllCalendarFolders: function (asDropdownStore) {
|
||||
asDropdownStore = Ext.isEmpty(asDropdownStore) ? false : asDropdownStore;
|
||||
/**
|
||||
* Get all calendar folders.
|
||||
* @param {boolean} asDropdownStore If true, a simple array store will be returned.
|
||||
* @returns {*}
|
||||
*/
|
||||
getAllCalendarFolders: function (asDropdownStore) {
|
||||
asDropdownStore = Ext.isEmpty(asDropdownStore) ? false : asDropdownStore;
|
||||
|
||||
var allFolders = [];
|
||||
var allFolders = [];
|
||||
|
||||
var inbox = container.getHierarchyStore().getDefaultStore();
|
||||
var pub = container.getHierarchyStore().getPublicStore();
|
||||
var inbox = container.getHierarchyStore().getDefaultStore();
|
||||
var pub = container.getHierarchyStore().getPublicStore();
|
||||
|
||||
if (!Ext.isEmpty(inbox.subStores) && inbox.subStores.folders.totalLength > 0) {
|
||||
for (var i = 0; i < inbox.subStores.folders.totalLength; i++) {
|
||||
var folder = inbox.subStores.folders.getAt(i);
|
||||
if (!Ext.isEmpty(folder) && folder.get("container_class") == "IPF.Appointment") {
|
||||
if (asDropdownStore) {
|
||||
allFolders.push([
|
||||
folder.get("entryid"),
|
||||
folder.get("display_name")
|
||||
]);
|
||||
} else {
|
||||
allFolders.push({
|
||||
display_name : folder.get("display_name"),
|
||||
entryid : folder.get("entryid"),
|
||||
store_entryid: folder.get("store_entryid"),
|
||||
is_public : false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Ext.isEmpty(inbox.subStores) && inbox.subStores.folders.totalLength > 0) {
|
||||
for (var i = 0; i < inbox.subStores.folders.totalLength; i++) {
|
||||
var folder = inbox.subStores.folders.getAt(i);
|
||||
if (!Ext.isEmpty(folder) && folder.get("container_class") == "IPF.Appointment") {
|
||||
if (asDropdownStore) {
|
||||
allFolders.push([
|
||||
folder.get("entryid"),
|
||||
folder.get("display_name")
|
||||
]);
|
||||
} else {
|
||||
allFolders.push({
|
||||
display_name: folder.get("display_name"),
|
||||
entryid: folder.get("entryid"),
|
||||
store_entryid: folder.get("store_entryid"),
|
||||
is_public: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Ext.isEmpty(pub.subStores) && pub.subStores.folders.totalLength > 0) {
|
||||
for (var j = 0; j < pub.subStores.folders.totalLength; j++) {
|
||||
var folder = pub.subStores.folders.getAt(j);
|
||||
if (!Ext.isEmpty(folder) && folder.get("container_class") == "IPF.Appointment") {
|
||||
if (asDropdownStore) {
|
||||
allFolders.push([
|
||||
folder.get("entryid"),
|
||||
folder.get("display_name") + " (Public)"
|
||||
]);
|
||||
} else {
|
||||
allFolders.push({
|
||||
display_name : folder.get("display_name"),
|
||||
entryid : folder.get("entryid"),
|
||||
store_entryid: folder.get("store_entryid"),
|
||||
is_public : true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Ext.isEmpty(pub.subStores) && pub.subStores.folders.totalLength > 0) {
|
||||
for (var j = 0; j < pub.subStores.folders.totalLength; j++) {
|
||||
var folder = pub.subStores.folders.getAt(j);
|
||||
if (!Ext.isEmpty(folder) && folder.get("container_class") == "IPF.Appointment") {
|
||||
if (asDropdownStore) {
|
||||
allFolders.push([
|
||||
folder.get("entryid"),
|
||||
folder.get("display_name") + " (Public)"
|
||||
]);
|
||||
} else {
|
||||
allFolders.push({
|
||||
display_name: folder.get("display_name"),
|
||||
entryid: folder.get("entryid"),
|
||||
store_entryid: folder.get("store_entryid"),
|
||||
is_public: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (asDropdownStore) {
|
||||
return allFolders.sort(Zarafa.plugins.calendarimporter.data.Actions.dynamicSort(1));
|
||||
} else {
|
||||
return allFolders;
|
||||
}
|
||||
},
|
||||
if (asDropdownStore) {
|
||||
return allFolders.sort(Zarafa.plugins.calendarimporter.data.Actions.dynamicSort(1));
|
||||
} else {
|
||||
return allFolders;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Return a calendar folder element by name.
|
||||
@@ -159,20 +159,20 @@ Zarafa.plugins.calendarimporter.data.Actions = {
|
||||
return container.getHierarchyStore().getDefaultFolder('calendar');
|
||||
},
|
||||
|
||||
/**
|
||||
* Dynamic sort function, sorts by property name.
|
||||
* @param {string|int} property
|
||||
* @returns {Function}
|
||||
*/
|
||||
dynamicSort: function (property) {
|
||||
var sortOrder = 1;
|
||||
if (property[0] === "-") {
|
||||
sortOrder = -1;
|
||||
property = property.substr(1);
|
||||
}
|
||||
return function (a, b) {
|
||||
var result = (a[property].toLowerCase() < b[property].toLowerCase()) ? -1 : (a[property].toLowerCase() > b[property].toLowerCase()) ? 1 : 0;
|
||||
return result * sortOrder;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Dynamic sort function, sorts by property name.
|
||||
* @param {string|int} property
|
||||
* @returns {Function}
|
||||
*/
|
||||
dynamicSort: function (property) {
|
||||
var sortOrder = 1;
|
||||
if (property[0] === "-") {
|
||||
sortOrder = -1;
|
||||
property = property.substr(1);
|
||||
}
|
||||
return function (a, b) {
|
||||
var result = (a[property].toLowerCase() < b[property].toLowerCase()) ? -1 : (a[property].toLowerCase() > b[property].toLowerCase()) ? 1 : 0;
|
||||
return result * sortOrder;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ResponseHandler.js zarafa calender to ics im/exporter
|
||||
* ResponseHandler.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -34,52 +34,52 @@ Ext.namespace('Zarafa.plugins.calendarimporter.data');
|
||||
* Calendar specific response handler.
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.data.ResponseHandler = Ext.extend(Zarafa.core.data.AbstractResponseHandler, {
|
||||
/**
|
||||
* @cfg {Function} successCallback The function which
|
||||
* will be called after success request.
|
||||
*/
|
||||
successCallback: null,
|
||||
/**
|
||||
* @cfg {Function} successCallback The function which
|
||||
* will be called after success request.
|
||||
*/
|
||||
successCallback: null,
|
||||
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doExport: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doExport: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doLoad: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doLoad: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doImport: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doImport: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doImportattachment: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
/**
|
||||
* Call the successCallback callback function.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doImportattachment: function (response) {
|
||||
this.successCallback(response);
|
||||
},
|
||||
|
||||
/**
|
||||
* In case exception happened on server, server will return
|
||||
* exception response with the code of exception.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doError: function (response) {
|
||||
alert("error response code: " + response.error.info.code);
|
||||
}
|
||||
/**
|
||||
* In case exception happened on server, server will return
|
||||
* exception response with the code of exception.
|
||||
* @param {Object} response Object contained the response data.
|
||||
*/
|
||||
doError: function (response) {
|
||||
alert("error response code: " + response.error.info.code);
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.calendarresponsehandler', Zarafa.plugins.calendarimporter.data.ResponseHandler);
|
1460
js/data/timezones.js
1460
js/data/timezones.js
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ImportContentPanel.js zarafa calender to ics im/exporter
|
||||
* ImportContentPanel.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -19,13 +19,13 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* ImportContentPanel
|
||||
*
|
||||
* Container for the importpanel.
|
||||
*/
|
||||
Ext.namespace("Zarafa.plugins.calendarimporter.dialogs");
|
||||
Ext.namespace("Zarafa.plugins.calendarimporter.dialogs");
|
||||
|
||||
/**
|
||||
* @class Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel
|
||||
@@ -36,31 +36,31 @@ Ext.namespace("Zarafa.plugins.calendarimporter.dialogs");
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel = Ext.extend(Zarafa.core.ui.ContentPanel, {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor : function(config) {
|
||||
config = config || {};
|
||||
Ext.applyIf(config, {
|
||||
layout : 'fit',
|
||||
title : _('Import Calendar File'),
|
||||
closeOnSave : true,
|
||||
width : 800,
|
||||
height : 700,
|
||||
//Add panel
|
||||
items : [
|
||||
{
|
||||
xtype : 'calendarimporter.importpanel',
|
||||
filename : config.filename,
|
||||
folder : config.folder
|
||||
}
|
||||
]
|
||||
});
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
Ext.applyIf(config, {
|
||||
layout: 'fit',
|
||||
title: dgettext('plugin_calendarimporter', 'Import Calendar File'),
|
||||
closeOnSave: true,
|
||||
width: 800,
|
||||
height: 700,
|
||||
//Add panel
|
||||
items: [
|
||||
{
|
||||
xtype: 'calendarimporter.importpanel',
|
||||
filename: config.filename,
|
||||
folder: config.folder
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel.superclass.constructor.call(this, config);
|
||||
}
|
||||
Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel.superclass.constructor.call(this, config);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.contentpanel' ,Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel);
|
||||
Ext.reg('calendarimporter.contentpanel', Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel);
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* plugin.calendarimporter.js zarafa calender to ics im/exporter
|
||||
* plugin.calendarimporter.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -24,285 +24,291 @@ Ext.namespace("Zarafa.plugins.calendarimporter"); // Assign the right na
|
||||
|
||||
Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, { // create new import plugin
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
Zarafa.plugins.calendarimporter.ImportPlugin.superclass.constructor.call(this, config);
|
||||
},
|
||||
Zarafa.plugins.calendarimporter.ImportPlugin.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* initialises insertion point for plugin
|
||||
* @protected
|
||||
*/
|
||||
initPlugin: function () {
|
||||
Zarafa.plugins.calendarimporter.ImportPlugin.superclass.initPlugin.apply(this, arguments);
|
||||
/**
|
||||
* initialises insertion point for plugin
|
||||
* @protected
|
||||
*/
|
||||
initPlugin: function () {
|
||||
Zarafa.plugins.calendarimporter.ImportPlugin.superclass.initPlugin.apply(this, arguments);
|
||||
|
||||
/* our panel */
|
||||
Zarafa.core.data.SharedComponentType.addProperty('plugins.calendarimporter.dialogs.importevents');
|
||||
/* our panel */
|
||||
Zarafa.core.data.SharedComponentType.addProperty('plugins.calendarimporter.dialogs.importevents');
|
||||
|
||||
/* directly import received icals */
|
||||
this.registerInsertionPoint('common.contextmenu.attachment.actions', this.createAttachmentImportButton);
|
||||
/* directly import received icals */
|
||||
this.registerInsertionPoint('common.contextmenu.attachment.actions', this.createAttachmentImportButton);
|
||||
|
||||
/* add settings widget */
|
||||
this.registerInsertionPoint('context.settings.category.calendar', this.createSettingsWidget);
|
||||
/* add settings widget */
|
||||
this.registerInsertionPoint('context.settings.category.calendar', this.createSettingsWidget);
|
||||
|
||||
/* export a calendar entry via rightclick */
|
||||
this.registerInsertionPoint('context.calendar.contextmenu.actions', this.createItemExportInsertionPoint, this);
|
||||
/* export a calendar entry via rightclick */
|
||||
this.registerInsertionPoint('context.calendar.contextmenu.actions', this.createItemExportInsertionPoint, this);
|
||||
|
||||
/* ical sync stuff */
|
||||
if (container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/enable_sync") === true) {
|
||||
/* edit panel */
|
||||
Zarafa.core.data.SharedComponentType.addProperty('plugins.calendarimporter.settings.dialogs.calsyncedit');
|
||||
/* ical sync stuff */
|
||||
if (container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/enable_sync") === true) {
|
||||
/* edit panel */
|
||||
Zarafa.core.data.SharedComponentType.addProperty('plugins.calendarimporter.settings.dialogs.calsyncedit');
|
||||
|
||||
/* enable the settings widget */
|
||||
this.registerInsertionPoint('context.settings.category.calendar', this.createSettingsCalSyncWidget);
|
||||
}
|
||||
},
|
||||
/* enable the settings widget */
|
||||
this.registerInsertionPoint('context.settings.category.calendar', this.createSettingsCalSyncWidget);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* This method hooks to the contact context menu and allows users to export users to vcf.
|
||||
*
|
||||
* @param include
|
||||
* @param btn
|
||||
* @returns {Object}
|
||||
*/
|
||||
createItemExportInsertionPoint: function (include, btn) {
|
||||
return {
|
||||
text : dgettext('plugin_files', 'Export Event'),
|
||||
handler: this.exportToICS.createDelegate(this, [btn]),
|
||||
scope : this,
|
||||
iconCls: 'icon_calendarimporter_export'
|
||||
};
|
||||
},
|
||||
/**
|
||||
* This method hooks to the contact context menu and allows users to export users to vcf.
|
||||
*
|
||||
* @param include
|
||||
* @param btn
|
||||
* @returns {Object}
|
||||
*/
|
||||
createItemExportInsertionPoint: function (include, btn) {
|
||||
return {
|
||||
text: dgettext('plugin_calendarimporter', 'Export Event'),
|
||||
handler: this.exportToICS.createDelegate(this, [btn]),
|
||||
scope: this,
|
||||
iconCls: 'icon_calendarimporter_export'
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates a request to download the selected records as vCard.
|
||||
* @param {Ext.Button} btn
|
||||
*/
|
||||
exportToICS: function (btn) {
|
||||
if (btn.records.length == 0) {
|
||||
return; // skip if no records where given!
|
||||
}
|
||||
/**
|
||||
* Generates a request to download the selected records as vCard.
|
||||
* @param {Ext.Button} btn
|
||||
*/
|
||||
exportToICS: function (btn) {
|
||||
if (btn.records.length == 0) {
|
||||
return; // skip if no records where given!
|
||||
}
|
||||
|
||||
var recordIds = [];
|
||||
var recordIds = [];
|
||||
|
||||
for (var i = 0; i < btn.records.length; i++) {
|
||||
recordIds.push(btn.records[i].get("entryid"));
|
||||
}
|
||||
for (var i = 0; i < btn.records.length; i++) {
|
||||
recordIds.push(btn.records[i].get("entryid"));
|
||||
}
|
||||
|
||||
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
|
||||
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS,
|
||||
scope : this
|
||||
});
|
||||
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
|
||||
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS,
|
||||
scope: this
|
||||
});
|
||||
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'calendarmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: btn.records[0].get("store_entryid"),
|
||||
records: recordIds
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
// Notify user
|
||||
// # TRANSLATORS: {0} will be replaced by the number of contacts that will be exported
|
||||
container.getNotifier().notify('info', dgettext('plugin_contactimporter', 'Calendar Export'), String.format(dgettext('plugin_calendarimporter', 'Exporting {0} events. Please wait...'), recordIds.length));
|
||||
|
||||
/**
|
||||
* Creates the button
|
||||
*
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*
|
||||
*/
|
||||
createSettingsWidget: function () {
|
||||
return [{
|
||||
xtype: 'calendarimporter.settingswidget'
|
||||
}];
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates the button
|
||||
*
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*
|
||||
*/
|
||||
createSettingsCalSyncWidget: function () {
|
||||
return [{
|
||||
xtype: 'calendarimporter.settingscalsyncwidget'
|
||||
}];
|
||||
},
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'calendarmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: btn.records[0].get("store_entryid"),
|
||||
records: recordIds
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert import button in all attachment suggestions
|
||||
/**
|
||||
* Creates the button
|
||||
*
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*
|
||||
*/
|
||||
createSettingsWidget: function () {
|
||||
return [{
|
||||
xtype: 'calendarimporter.settingswidget'
|
||||
}];
|
||||
},
|
||||
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*/
|
||||
createAttachmentImportButton: function (include, btn) {
|
||||
return {
|
||||
text : _('Import to Calendar'),
|
||||
handler : this.getAttachmentFileName.createDelegate(this, [btn]),
|
||||
scope : this,
|
||||
iconCls : 'icon_calendarimporter_button',
|
||||
beforeShow: function (item, record) {
|
||||
var extension = record.data.name.split('.').pop().toLowerCase();
|
||||
/**
|
||||
* Creates the button
|
||||
*
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*
|
||||
*/
|
||||
createSettingsCalSyncWidget: function () {
|
||||
return [{
|
||||
xtype: 'calendarimporter.settingscalsyncwidget'
|
||||
}];
|
||||
},
|
||||
|
||||
if (record.data.filetype == "text/calendar" || extension == "ics" || extension == "ifb" || extension == "ical" || extension == "ifbf") {
|
||||
item.setVisible(true);
|
||||
} else {
|
||||
item.setVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Insert import button in all attachment suggestions
|
||||
|
||||
/**
|
||||
* Callback for getAttachmentFileName
|
||||
*/
|
||||
gotAttachmentFileName: function (response) {
|
||||
if (response.status == true) {
|
||||
this.scope.openImportDialog(response.tmpname);
|
||||
} else {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title : _('Error'),
|
||||
msg : _(response["message"]),
|
||||
icon : Zarafa.common.dialogs.MessageBox.ERROR,
|
||||
buttons: Zarafa.common.dialogs.MessageBox.OK
|
||||
});
|
||||
}
|
||||
},
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*/
|
||||
createAttachmentImportButton: function (include, btn) {
|
||||
return {
|
||||
text: dgettext('plugin_calendarimporter', 'Import to Calendar'),
|
||||
handler: this.getAttachmentFileName.createDelegate(this, [btn]),
|
||||
scope: this,
|
||||
iconCls: 'icon_calendarimporter_button',
|
||||
beforeShow: function (item, record) {
|
||||
var extension = record.data.name.split('.').pop().toLowerCase();
|
||||
|
||||
/**
|
||||
* Clickhandler for the button
|
||||
*/
|
||||
getAttachmentFileName: function (btn, callback) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title : 'Please wait',
|
||||
msg : 'Loading attachment...',
|
||||
progressText: 'Initializing...',
|
||||
width : 300,
|
||||
progress : true,
|
||||
closable : false
|
||||
});
|
||||
if (record.data.filetype == "text/calendar" || extension == "ics" || extension == "ifb" || extension == "ical" || extension == "ifbf") {
|
||||
item.setVisible(true);
|
||||
} else {
|
||||
item.setVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
// progress bar... ;)
|
||||
var f = function (v) {
|
||||
return function () {
|
||||
if (v == 100) {
|
||||
Zarafa.common.dialogs.MessageBox.hide();
|
||||
} else {
|
||||
Zarafa.common.dialogs.MessageBox.updateProgress(v / 100, Math.round(v) + '% loaded');
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Callback for getAttachmentFileName
|
||||
*/
|
||||
gotAttachmentFileName: function (response) {
|
||||
if (response.status == true) {
|
||||
this.scope.openImportDialog(response.tmpname);
|
||||
} else {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_calendarimporter', 'Error'),
|
||||
msg: response["message"],
|
||||
icon: Zarafa.common.dialogs.MessageBox.ERROR,
|
||||
buttons: Zarafa.common.dialogs.MessageBox.OK
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
for (var i = 1; i < 101; i++) {
|
||||
setTimeout(f(i), 20 * i);
|
||||
}
|
||||
/**
|
||||
* Clickhandler for the button
|
||||
*/
|
||||
getAttachmentFileName: function (btn, callback) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_calendarimporter', 'Please wait'),
|
||||
msg: dgettext('plugin_calendarimporter', 'Loading attachment...'),
|
||||
progressText: dgettext('plugin_calendarimporter', 'Initializing...'),
|
||||
width: 300,
|
||||
progress: true,
|
||||
closable: false
|
||||
});
|
||||
|
||||
/* store the attachment to a temporary folder and prepare it for uploading */
|
||||
var attachmentRecord = btn.records;
|
||||
var attachmentStore = attachmentRecord.store;
|
||||
// progress bar... ;)
|
||||
var f = function (v) {
|
||||
return function () {
|
||||
if (v == 100) {
|
||||
Zarafa.common.dialogs.MessageBox.hide();
|
||||
} else {
|
||||
// # TRANSLATORS: {0} will be replaced by the percentage value (0-100)
|
||||
Zarafa.common.dialogs.MessageBox.updateProgress(v / 100, String.format(dgettext('plugin_calendarimporter', '{0}% loaded'), Math.round(v)));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var store = attachmentStore.getParentRecord().get('store_entryid');
|
||||
var entryid = attachmentStore.getAttachmentParentRecordEntryId();
|
||||
var attachNum = new Array(1);
|
||||
if (attachmentRecord.get('attach_num') != -1) {
|
||||
attachNum[0] = attachmentRecord.get('attach_num');
|
||||
} else {
|
||||
attachNum[0] = attachmentRecord.get('tmpname');
|
||||
}
|
||||
var dialog_attachments = attachmentStore.getId();
|
||||
var filename = attachmentRecord.data.name;
|
||||
for (var i = 1; i < 101; i++) {
|
||||
setTimeout(f(i), 20 * i);
|
||||
}
|
||||
|
||||
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
|
||||
successCallback: this.gotAttachmentFileName,
|
||||
scope : this
|
||||
});
|
||||
/* store the attachment to a temporary folder and prepare it for uploading */
|
||||
var attachmentRecord = btn.records;
|
||||
var attachmentStore = attachmentRecord.store;
|
||||
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'calendarmodule',
|
||||
'importattachment',
|
||||
{
|
||||
entryid : entryid,
|
||||
store : store,
|
||||
attachNum : attachNum,
|
||||
dialog_attachments: dialog_attachments,
|
||||
filename : filename
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
var store = attachmentStore.getParentRecord().get('store_entryid');
|
||||
var entryid = attachmentStore.getAttachmentParentRecordEntryId();
|
||||
var attachNum = new Array(1);
|
||||
if (attachmentRecord.get('attach_num') != -1) {
|
||||
attachNum[0] = attachmentRecord.get('attach_num');
|
||||
} else {
|
||||
attachNum[0] = attachmentRecord.get('tmpname');
|
||||
}
|
||||
var dialog_attachments = attachmentStore.getId();
|
||||
var filename = attachmentRecord.data.name;
|
||||
|
||||
/**
|
||||
* Open the import dialog.
|
||||
* @param {String} filename
|
||||
*/
|
||||
openImportDialog: function (filename) {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents'];
|
||||
var config = {
|
||||
filename: filename,
|
||||
modal : true
|
||||
};
|
||||
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
|
||||
successCallback: this.gotAttachmentFileName,
|
||||
scope: this
|
||||
});
|
||||
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
},
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'calendarmodule',
|
||||
'importattachment',
|
||||
{
|
||||
entryid: entryid,
|
||||
store: store,
|
||||
attachNum: attachNum,
|
||||
dialog_attachments: dialog_attachments,
|
||||
filename: filename
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Bid for the type of shared component
|
||||
* and the given record.
|
||||
* This will bid on calendar.dialogs.importevents
|
||||
* @param {Zarafa.core.data.SharedComponentType} type Type of component a context can bid for.
|
||||
* @param {Ext.data.Record} record Optionally passed record.
|
||||
* @return {Number} The bid for the shared component
|
||||
*/
|
||||
bidSharedComponent: function (type, record) {
|
||||
var bid = -1;
|
||||
switch (type) {
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents']:
|
||||
bid = 2;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit']:
|
||||
bid = 2;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['common.contextmenu']:
|
||||
if (record instanceof Zarafa.core.data.MAPIRecord) {
|
||||
if (record.get('object_type') == Zarafa.core.mapi.ObjectType.MAPI_FOLDER && record.get('container_class') == "IPF.Appointment") {
|
||||
bid = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return bid;
|
||||
},
|
||||
/**
|
||||
* Open the import dialog.
|
||||
* @param {String} filename
|
||||
*/
|
||||
openImportDialog: function (filename) {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents'];
|
||||
var config = {
|
||||
filename: filename,
|
||||
modal: true
|
||||
};
|
||||
|
||||
/**
|
||||
* Will return the reference to the shared component.
|
||||
* Based on the type of component requested a component is returned.
|
||||
* @param {Zarafa.core.data.SharedComponentType} type Type of component a context can bid for.
|
||||
* @param {Ext.data.Record} record Optionally passed record.
|
||||
* @return {Ext.Component} Component
|
||||
*/
|
||||
getSharedComponent: function (type, record) {
|
||||
var component;
|
||||
switch (type) {
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents']:
|
||||
component = Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit']:
|
||||
component = Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['common.contextmenu']:
|
||||
component = Zarafa.plugins.calendarimporter.ui.ContextMenu;
|
||||
break;
|
||||
}
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
},
|
||||
|
||||
return component;
|
||||
}
|
||||
/**
|
||||
* Bid for the type of shared component
|
||||
* and the given record.
|
||||
* This will bid on calendar.dialogs.importevents
|
||||
* @param {Zarafa.core.data.SharedComponentType} type Type of component a context can bid for.
|
||||
* @param {Ext.data.Record} record Optionally passed record.
|
||||
* @return {Number} The bid for the shared component
|
||||
*/
|
||||
bidSharedComponent: function (type, record) {
|
||||
var bid = -1;
|
||||
switch (type) {
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents']:
|
||||
bid = 2;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit']:
|
||||
bid = 2;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['common.contextmenu']:
|
||||
if (record instanceof Zarafa.core.data.MAPIRecord) {
|
||||
if (record.get('object_type') == Zarafa.core.mapi.ObjectType.MAPI_FOLDER && record.get('container_class') == "IPF.Appointment") {
|
||||
bid = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return bid;
|
||||
},
|
||||
|
||||
/**
|
||||
* Will return the reference to the shared component.
|
||||
* Based on the type of component requested a component is returned.
|
||||
* @param {Zarafa.core.data.SharedComponentType} type Type of component a context can bid for.
|
||||
* @param {Ext.data.Record} record Optionally passed record.
|
||||
* @return {Ext.Component} Component
|
||||
*/
|
||||
getSharedComponent: function (type, record) {
|
||||
var component;
|
||||
switch (type) {
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents']:
|
||||
component = Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit']:
|
||||
component = Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['common.contextmenu']:
|
||||
component = Zarafa.plugins.calendarimporter.ui.ContextMenu;
|
||||
break;
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -310,10 +316,10 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
|
||||
* STARTUP
|
||||
*############################################################################################################################*/
|
||||
Zarafa.onReady(function () {
|
||||
container.registerPlugin(new Zarafa.core.PluginMetaData({
|
||||
name : 'calendarimporter',
|
||||
displayName : _('Calendarimporter Plugin'),
|
||||
about : Zarafa.plugins.calendarimporter.ABOUT,
|
||||
pluginConstructor: Zarafa.plugins.calendarimporter.ImportPlugin
|
||||
}));
|
||||
container.registerPlugin(new Zarafa.core.PluginMetaData({
|
||||
name: 'calendarimporter',
|
||||
displayName: dgettext('plugin_calendarimporter', 'Calendarimporter Plugin'),
|
||||
about: Zarafa.plugins.calendarimporter.ABOUT,
|
||||
pluginConstructor: Zarafa.plugins.calendarimporter.ImportPlugin
|
||||
}));
|
||||
});
|
||||
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* SettingsCalSyncWidget.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter.settings');
|
||||
|
||||
/**
|
||||
@@ -7,108 +29,108 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings');
|
||||
*
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.settings.SettingsCalSyncWidget = Ext.extend(Zarafa.settings.ui.SettingsWidget, {
|
||||
/**
|
||||
* @cfg {Zarafa.settings.SettingsContext} settingsContext
|
||||
*/
|
||||
settingsContext : undefined,
|
||||
/**
|
||||
* @cfg {Zarafa.settings.SettingsContext} settingsContext
|
||||
*/
|
||||
settingsContext: undefined,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*/
|
||||
constructor : function(config) {
|
||||
config = config || {};
|
||||
|
||||
var store = new Ext.data.JsonStore({
|
||||
fields : [
|
||||
{ name : 'id', type : 'int' },
|
||||
{ name : 'icsurl' },
|
||||
{ name : 'user' },
|
||||
{ name : 'pass' },
|
||||
{ name : 'intervall', type : 'int' },
|
||||
{ name : 'calendar' },
|
||||
{ name : 'calendarname' },
|
||||
{ name : 'lastsync' }
|
||||
],
|
||||
sortInfo : {
|
||||
field : 'id',
|
||||
direction : 'ASC'
|
||||
},
|
||||
autoDestroy : true
|
||||
});
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
Ext.applyIf(config, {
|
||||
height : 400,
|
||||
title : _('Calendar Sync settings'),
|
||||
xtype : 'calendarimporter.settingscalsyncwidget',
|
||||
layout : {
|
||||
// override from SettingsWidget
|
||||
type : 'fit'
|
||||
},
|
||||
items : [{
|
||||
xtype : 'calendarimporter.calsyncpanel',
|
||||
store : store,
|
||||
ref : 'calsyncPanel'
|
||||
}]
|
||||
});
|
||||
var store = new Ext.data.JsonStore({
|
||||
fields: [
|
||||
{name: 'id', type: 'int'},
|
||||
{name: 'icsurl'},
|
||||
{name: 'user'},
|
||||
{name: 'pass'},
|
||||
{name: 'intervall', type: 'int'},
|
||||
{name: 'calendar'},
|
||||
{name: 'calendarname'},
|
||||
{name: 'lastsync'}
|
||||
],
|
||||
sortInfo: {
|
||||
field: 'id',
|
||||
direction: 'ASC'
|
||||
},
|
||||
autoDestroy: true
|
||||
});
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.SettingsCalSyncWidget.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#update}.
|
||||
* This is used to load the latest version of the settings from the
|
||||
* {@link Zarafa.settings.SettingsModel} into the UI of this category.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to load
|
||||
*/
|
||||
update : function(settingsModel) {
|
||||
this.model = settingsModel;
|
||||
Ext.applyIf(config, {
|
||||
height: 400,
|
||||
title: dgettext('plugin_calendarimporter', 'Calendar Sync settings'),
|
||||
xtype: 'calendarimporter.settingscalsyncwidget',
|
||||
layout: {
|
||||
// override from SettingsWidget
|
||||
type: 'fit'
|
||||
},
|
||||
items: [{
|
||||
xtype: 'calendarimporter.calsyncpanel',
|
||||
store: store,
|
||||
ref: 'calsyncPanel'
|
||||
}]
|
||||
});
|
||||
|
||||
// Convert the signatures into Store data
|
||||
var icslinks = settingsModel.get('zarafa/v1/contexts/calendar/icssync', true);
|
||||
var syncArray = [];
|
||||
for (var key in icslinks) {
|
||||
if(icslinks.hasOwnProperty(key)) { // skip inherited props
|
||||
syncArray.push(Ext.apply({}, icslinks[key], {id: key}));
|
||||
}
|
||||
}
|
||||
Zarafa.plugins.calendarimporter.settings.SettingsCalSyncWidget.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
// Load all icslinks into the GridPanel
|
||||
var store = this.calsyncPanel.calsyncGrid.getStore();
|
||||
store.loadData(syncArray);
|
||||
},
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#update}.
|
||||
* This is used to load the latest version of the settings from the
|
||||
* {@link Zarafa.settings.SettingsModel} into the UI of this category.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to load
|
||||
*/
|
||||
update: function (settingsModel) {
|
||||
this.model = settingsModel;
|
||||
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#updateSettings}.
|
||||
* This is used to update the settings from the UI into the {@link Zarafa.settings.SettingsModel settings model}.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to update
|
||||
*/
|
||||
updateSettings : function(settingsModel) {
|
||||
settingsModel.beginEdit();
|
||||
// Convert the signatures into Store data
|
||||
var icslinks = settingsModel.get('zarafa/v1/contexts/calendar/icssync', true);
|
||||
var syncArray = [];
|
||||
for (var key in icslinks) {
|
||||
if (icslinks.hasOwnProperty(key)) { // skip inherited props
|
||||
syncArray.push(Ext.apply({}, icslinks[key], {id: key}));
|
||||
}
|
||||
}
|
||||
|
||||
// Start reading the Grid store and convert the contents back into
|
||||
// an object which can be pushed to the settings.
|
||||
var icslinks = this.calsyncPanel.calsyncGrid.getStore().getRange();
|
||||
var icslinkData = {};
|
||||
for (var i = 0, len = icslinks.length; i < len; i++) {
|
||||
var icslink = icslinks[i];
|
||||
// Load all icslinks into the GridPanel
|
||||
var store = this.calsyncPanel.calsyncGrid.getStore();
|
||||
store.loadData(syncArray);
|
||||
},
|
||||
|
||||
icslinkData[icslink.get('id')] = {
|
||||
'icsurl' : icslink.get('icsurl'),
|
||||
'intervall' : icslink.get('intervall'),
|
||||
'user' : icslink.get('user'),
|
||||
'pass' : icslink.get('pass'),
|
||||
'lastsync' : icslink.get('lastsync'),
|
||||
'calendar' : icslink.get('calendar'),
|
||||
'calendarname' : Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(icslink.get('calendar')).display_name
|
||||
};
|
||||
}
|
||||
settingsModel.set('zarafa/v1/contexts/calendar/icssync', icslinkData);
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#updateSettings}.
|
||||
* This is used to update the settings from the UI into the {@link Zarafa.settings.SettingsModel settings model}.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to update
|
||||
*/
|
||||
updateSettings: function (settingsModel) {
|
||||
settingsModel.beginEdit();
|
||||
|
||||
settingsModel.endEdit();
|
||||
}
|
||||
// Start reading the Grid store and convert the contents back into
|
||||
// an object which can be pushed to the settings.
|
||||
var icslinks = this.calsyncPanel.calsyncGrid.getStore().getRange();
|
||||
var icslinkData = {};
|
||||
for (var i = 0, len = icslinks.length; i < len; i++) {
|
||||
var icslink = icslinks[i];
|
||||
|
||||
icslinkData[icslink.get('id')] = {
|
||||
'icsurl': icslink.get('icsurl'),
|
||||
'intervall': icslink.get('intervall'),
|
||||
'user': icslink.get('user'),
|
||||
'pass': icslink.get('pass'),
|
||||
'lastsync': icslink.get('lastsync'),
|
||||
'calendar': icslink.get('calendar'),
|
||||
'calendarname': Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(icslink.get('calendar')).display_name
|
||||
};
|
||||
}
|
||||
settingsModel.set('zarafa/v1/contexts/calendar/icssync', icslinkData);
|
||||
|
||||
settingsModel.endEdit();
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.settingscalsyncwidget', Zarafa.plugins.calendarimporter.settings.SettingsCalSyncWidget);
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* SettingsWidget.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter.settings');
|
||||
|
||||
/**
|
||||
@@ -7,110 +29,109 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings');
|
||||
*
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.settings.ui.SettingsWidget, {
|
||||
/**
|
||||
* @cfg {Zarafa.settings.SettingsContext} settingsContext
|
||||
*/
|
||||
settingsContext : undefined,
|
||||
/**
|
||||
* @cfg {Zarafa.settings.SettingsContext} settingsContext
|
||||
*/
|
||||
settingsContext: undefined,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*/
|
||||
constructor : function(config)
|
||||
{
|
||||
config = config || {};
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
Ext.applyIf(config, {
|
||||
title : _('Calendar Import/Export plugin settings'),
|
||||
xtype : 'calendarimporter.settingswidget',
|
||||
items : [
|
||||
{
|
||||
xtype : 'checkbox',
|
||||
name : 'zarafa/v1/plugins/calendarimporter/enable_sync',
|
||||
ref : 'enableSync',
|
||||
fieldLabel : 'Enable ical sync',
|
||||
lazyInit : false
|
||||
},
|
||||
this.createSelectBox(),
|
||||
this.createTimezoneBox()
|
||||
]
|
||||
});
|
||||
Ext.applyIf(config, {
|
||||
title: dgettext('plugin_calendarimporter', 'Calendar Import/Export plugin settings'),
|
||||
xtype: 'calendarimporter.settingswidget',
|
||||
items: [
|
||||
{
|
||||
xtype: 'checkbox',
|
||||
name: 'zarafa/v1/plugins/calendarimporter/enable_sync',
|
||||
ref: 'enableSync',
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Enable ical sync'),
|
||||
lazyInit: false
|
||||
},
|
||||
this.createSelectBox(),
|
||||
this.createTimezoneBox()
|
||||
]
|
||||
});
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.SettingsWidget.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
createSelectBox: function() {
|
||||
var myStore = Zarafa.plugins.calendarimporter.data.Actions.getAllCalendarFolders(true);
|
||||
Zarafa.plugins.calendarimporter.settings.SettingsWidget.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
return {
|
||||
xtype: "selectbox",
|
||||
ref : 'defaultCalendar',
|
||||
editable: false,
|
||||
name: "zarafa/v1/plugins/calendarimporter/default_calendar",
|
||||
createSelectBox: function () {
|
||||
var myStore = Zarafa.plugins.calendarimporter.data.Actions.getAllCalendarFolders(true);
|
||||
|
||||
return {
|
||||
xtype: "selectbox",
|
||||
ref: 'defaultCalendar',
|
||||
editable: false,
|
||||
name: "zarafa/v1/plugins/calendarimporter/default_calendar",
|
||||
value: Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByName(container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/default_calendar")).entryid,
|
||||
width: 100,
|
||||
fieldLabel: "Default calender",
|
||||
store: myStore,
|
||||
mode: 'local',
|
||||
labelSeperator: ":",
|
||||
border: false,
|
||||
anchor: "100%",
|
||||
scope: this,
|
||||
allowBlank: false
|
||||
}
|
||||
},
|
||||
|
||||
createTimezoneBox: function() {
|
||||
return {
|
||||
xtype: "selectbox",
|
||||
ref : 'defaultTimezone',
|
||||
editable: false,
|
||||
name: "zarafa/v1/plugins/calendarimporter/default_timezone",
|
||||
value: Zarafa.plugins.calendarimporter.data.Timezones.unMap(container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/default_timezone")),
|
||||
width: 100,
|
||||
fieldLabel: "Default timezone",
|
||||
store: Zarafa.plugins.calendarimporter.data.Timezones.store,
|
||||
labelSeperator: ":",
|
||||
mode: 'local',
|
||||
border: false,
|
||||
anchor: "100%",
|
||||
scope: this,
|
||||
allowBlank: false
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#update}.
|
||||
* This is used to load the latest version of the settings from the
|
||||
* {@link Zarafa.settings.SettingsModel} into the UI of this category.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to load
|
||||
*/
|
||||
update : function(settingsModel) {
|
||||
this.enableSync.setValue(settingsModel.get(this.enableSync.name));
|
||||
this.defaultCalendar.setValue(Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByName(settingsModel.get(this.defaultCalendar.name)).entryid);
|
||||
this.defaultTimezone.setValue(settingsModel.get(this.defaultTimezone.name));
|
||||
},
|
||||
width: 100,
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Default calender'),
|
||||
store: myStore,
|
||||
mode: 'local',
|
||||
labelSeperator: ":",
|
||||
border: false,
|
||||
anchor: "100%",
|
||||
scope: this,
|
||||
allowBlank: false
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#updateSettings}.
|
||||
* This is used to update the settings from the UI into the {@link Zarafa.settings.SettingsModel settings model}.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to update
|
||||
*/
|
||||
updateSettings : function(settingsModel) {
|
||||
createTimezoneBox: function () {
|
||||
return {
|
||||
xtype: "selectbox",
|
||||
ref: 'defaultTimezone',
|
||||
editable: false,
|
||||
name: "zarafa/v1/plugins/calendarimporter/default_timezone",
|
||||
value: Zarafa.plugins.calendarimporter.data.Timezones.unMap(container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/default_timezone")),
|
||||
width: 100,
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Default timezone'),
|
||||
store: Zarafa.plugins.calendarimporter.data.Timezones.store,
|
||||
labelSeperator: ":",
|
||||
mode: 'local',
|
||||
border: false,
|
||||
anchor: "100%",
|
||||
scope: this,
|
||||
allowBlank: false
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#update}.
|
||||
* This is used to load the latest version of the settings from the
|
||||
* {@link Zarafa.settings.SettingsModel} into the UI of this category.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to load
|
||||
*/
|
||||
update: function (settingsModel) {
|
||||
this.enableSync.setValue(settingsModel.get(this.enableSync.name));
|
||||
this.defaultCalendar.setValue(Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByName(settingsModel.get(this.defaultCalendar.name)).entryid);
|
||||
this.defaultTimezone.setValue(settingsModel.get(this.defaultTimezone.name));
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by the {@link Zarafa.settings.ui.SettingsCategory Category} when
|
||||
* it has been called with {@link zarafa.settings.ui.SettingsCategory#updateSettings}.
|
||||
* This is used to update the settings from the UI into the {@link Zarafa.settings.SettingsModel settings model}.
|
||||
* @param {Zarafa.settings.SettingsModel} settingsModel The settings to update
|
||||
*/
|
||||
updateSettings: function (settingsModel) {
|
||||
// check if the user changed a value
|
||||
var changed = false;
|
||||
|
||||
if(settingsModel.get(this.enableSync.name) != this.enableSync.getValue()) {
|
||||
if (settingsModel.get(this.enableSync.name) != this.enableSync.getValue()) {
|
||||
changed = true;
|
||||
} else if(settingsModel.get(this.defaultCalendar.name) != Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(this.defaultCalendar.getValue()).display_name) {
|
||||
} else if (settingsModel.get(this.defaultCalendar.name) != Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(this.defaultCalendar.getValue()).display_name) {
|
||||
changed = true;
|
||||
} else if(settingsModel.get(this.defaultTimezone.name) != this.defaultTimezone.getValue()) {
|
||||
} else if (settingsModel.get(this.defaultTimezone.name) != this.defaultTimezone.getValue()) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if(changed) {
|
||||
if (changed) {
|
||||
// Really save changes
|
||||
settingsModel.set(this.enableSync.name, this.enableSync.getValue());
|
||||
settingsModel.set(this.defaultCalendar.name, Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(this.defaultCalendar.getValue()).display_name); // store name
|
||||
@@ -118,7 +139,7 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
|
||||
this.onUpdateSettings();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Called after the {@link Zarafa.settings.SettingsModel} fires the {@link Zarafa.settings.SettingsModel#save save}
|
||||
@@ -126,8 +147,7 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
* settings which were saved to the server.
|
||||
* @private
|
||||
*/
|
||||
onUpdateSettings : function()
|
||||
{
|
||||
onUpdateSettings: function () {
|
||||
var message = _('Your WebApp needs to be reloaded to make the changes visible!');
|
||||
message += '<br/><br/>';
|
||||
message += _('WebApp will automatically restart in order for these changes to take effect');
|
||||
@@ -135,17 +155,17 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
|
||||
Zarafa.common.dialogs.MessageBox.addCustomButtons({
|
||||
title: _('Restart WebApp'),
|
||||
msg : message,
|
||||
msg: message,
|
||||
icon: Ext.MessageBox.QUESTION,
|
||||
fn : this.restartWebapp,
|
||||
customButton : [{
|
||||
text : _('Restart'),
|
||||
name : 'restart'
|
||||
fn: this.restartWebapp,
|
||||
customButton: [{
|
||||
text: _('Restart'),
|
||||
name: 'restart'
|
||||
}, {
|
||||
text : _('Cancel'),
|
||||
name : 'cancel'
|
||||
text: _('Cancel'),
|
||||
name: 'cancel'
|
||||
}],
|
||||
scope : this
|
||||
scope: this
|
||||
});
|
||||
|
||||
},
|
||||
@@ -156,8 +176,7 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
* @param {String} button The button which user pressed.
|
||||
* @private
|
||||
*/
|
||||
restartWebapp : function(button)
|
||||
{
|
||||
restartWebapp: function (button) {
|
||||
if (button === 'restart') {
|
||||
var contextModel = this.ownerCt.settingsContext.getModel();
|
||||
var realModel = contextModel.getRealSettingsModel();
|
||||
@@ -165,7 +184,7 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
realModel.save();
|
||||
|
||||
this.loadMask = new Zarafa.common.ui.LoadMask(Ext.getBody(), {
|
||||
msg : '<b>' + _('Webapp is reloading, Please wait.') + '</b>'
|
||||
msg: '<b>' + _('Webapp is reloading, Please wait.') + '</b>'
|
||||
});
|
||||
this.loadMask.show();
|
||||
|
||||
@@ -183,8 +202,7 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
* settings which were saved to the server.
|
||||
* @private
|
||||
*/
|
||||
onSettingsSave : function(model, parameters)
|
||||
{
|
||||
onSettingsSave: function (model, parameters) {
|
||||
this.mun(model, 'save', this.onSettingsSave, this);
|
||||
Zarafa.core.Util.reloadWebapp();
|
||||
},
|
||||
@@ -200,8 +218,7 @@ Zarafa.plugins.calendarimporter.settings.SettingsWidget = Ext.extend(Zarafa.sett
|
||||
* @param {Object} response The response object as received from the PHP-side
|
||||
* @private
|
||||
*/
|
||||
onSettingsException : function(model, type, action, options, response)
|
||||
{
|
||||
onSettingsException: function (model, type, action, options, response) {
|
||||
this.loadMask.hide();
|
||||
|
||||
// Remove event handlers
|
||||
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* CalSyncEditContentPanel.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter.settings.dialogs');
|
||||
|
||||
/**
|
||||
@@ -8,31 +30,31 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings.dialogs');
|
||||
* {@link Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel CalSyncEditContentPanel} will be used to edit ics sync entries.
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel = Ext.extend(Zarafa.core.ui.ContentPanel, {
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor : function(config) {
|
||||
config = config || {};
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
// Add in some standard configuration data.
|
||||
Ext.applyIf(config, {
|
||||
// Override from Ext.Component
|
||||
xtype : 'calendarimporter.calsynceditcontentpanel',
|
||||
layout : 'fit',
|
||||
model : true,
|
||||
autoSave : false,
|
||||
width : 400,
|
||||
height : 400,
|
||||
title : _('ICAL Sync'),
|
||||
items : [{
|
||||
xtype : 'calendarimporter.calsynceditpanel',
|
||||
item : config.item
|
||||
}]
|
||||
});
|
||||
// Add in some standard configuration data.
|
||||
Ext.applyIf(config, {
|
||||
// Override from Ext.Component
|
||||
xtype: 'calendarimporter.calsynceditcontentpanel',
|
||||
layout: 'fit',
|
||||
model: true,
|
||||
autoSave: false,
|
||||
width: 400,
|
||||
height: 400,
|
||||
title: dgettext('plugin_calendarimporter', 'ICAL Sync'),
|
||||
items: [{
|
||||
xtype: 'calendarimporter.calsynceditpanel',
|
||||
item: config.item
|
||||
}]
|
||||
});
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel.superclass.constructor.call(this, config);
|
||||
}
|
||||
Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel.superclass.constructor.call(this, config);
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.calsynceditcontentpanel', Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditContentPanel);
|
||||
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* CalSyncEditPanel.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter.settings.dialogs');
|
||||
|
||||
/**
|
||||
@@ -8,195 +30,194 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings.dialogs');
|
||||
* Will generate UI for {@link Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel CalSyncEditPanel}.
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel = Ext.extend(Ext.form.FormPanel, {
|
||||
|
||||
/**
|
||||
* the id of the currently edited item
|
||||
*/
|
||||
currentItem : undefined,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor : function(config) {
|
||||
config = config || {};
|
||||
|
||||
if(config.item)
|
||||
this.currentItem = config.item;
|
||||
/**
|
||||
* the id of the currently edited item
|
||||
*/
|
||||
currentItem: undefined,
|
||||
|
||||
Ext.applyIf(config, {
|
||||
// Override from Ext.Component
|
||||
xtype : 'calendarimporter.calsynceditpanel',
|
||||
labelAlign : 'top',
|
||||
defaultType: 'textfield',
|
||||
items : this.createPanelItems(config),
|
||||
buttons: [{
|
||||
text: _('Save'),
|
||||
handler: this.doSave,
|
||||
scope: this
|
||||
},
|
||||
{
|
||||
text: _('Cancel'),
|
||||
handler: this.doClose,
|
||||
scope: this
|
||||
}]
|
||||
});
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* close the dialog
|
||||
*/
|
||||
doClose : function() {
|
||||
this.dialog.close();
|
||||
},
|
||||
|
||||
/**
|
||||
* save the data to the store
|
||||
*/
|
||||
doSave : function() {
|
||||
var store = this.dialog.store;
|
||||
var id = 0;
|
||||
var record = undefined;
|
||||
if (config.item)
|
||||
this.currentItem = config.item;
|
||||
|
||||
if(!this.currentItem) {
|
||||
record = new store.recordType({
|
||||
id: this.hashCode(this.icsurl.getValue()),
|
||||
icsurl: this.icsurl.getValue(),
|
||||
intervall: this.intervall.getValue(),
|
||||
user: this.user.getValue(),
|
||||
pass: Ext.util.base64.encode(this.pass.getValue()),
|
||||
calendar: this.calendar.getValue(),
|
||||
calendarname : Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(this.calendar.getValue()).display_name,
|
||||
lastsync: "never"
|
||||
});
|
||||
}
|
||||
|
||||
if(this.icsurl.isValid()) {
|
||||
if(record) {
|
||||
store.add(record);
|
||||
} else {
|
||||
this.currentItem.set('icsurl', this.icsurl.getValue());
|
||||
this.currentItem.set('intervall', this.intervall.getValue());
|
||||
this.currentItem.set('user', this.user.getValue());
|
||||
this.currentItem.set('pass', Ext.util.base64.encode(this.pass.getValue()));
|
||||
this.currentItem.set('calendar', this.calendar.getValue());
|
||||
Ext.applyIf(config, {
|
||||
// Override from Ext.Component
|
||||
xtype: 'calendarimporter.calsynceditpanel',
|
||||
labelAlign: 'top',
|
||||
defaultType: 'textfield',
|
||||
items: this.createPanelItems(config),
|
||||
buttons: [{
|
||||
text: _('Save'),
|
||||
handler: this.doSave,
|
||||
scope: this
|
||||
},
|
||||
{
|
||||
text: _('Cancel'),
|
||||
handler: this.doClose,
|
||||
scope: this
|
||||
}]
|
||||
});
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* close the dialog
|
||||
*/
|
||||
doClose: function () {
|
||||
this.dialog.close();
|
||||
},
|
||||
|
||||
/**
|
||||
* save the data to the store
|
||||
*/
|
||||
doSave: function () {
|
||||
var store = this.dialog.store;
|
||||
var id = 0;
|
||||
var record = undefined;
|
||||
|
||||
if (!this.currentItem) {
|
||||
record = new store.recordType({
|
||||
id: this.hashCode(this.icsurl.getValue()),
|
||||
icsurl: this.icsurl.getValue(),
|
||||
intervall: this.intervall.getValue(),
|
||||
user: this.user.getValue(),
|
||||
pass: Ext.util.base64.encode(this.pass.getValue()),
|
||||
calendar: this.calendar.getValue(),
|
||||
calendarname: Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(this.calendar.getValue()).display_name,
|
||||
lastsync: "never"
|
||||
});
|
||||
}
|
||||
|
||||
if (this.icsurl.isValid()) {
|
||||
if (record) {
|
||||
store.add(record);
|
||||
} else {
|
||||
this.currentItem.set('icsurl', this.icsurl.getValue());
|
||||
this.currentItem.set('intervall', this.intervall.getValue());
|
||||
this.currentItem.set('user', this.user.getValue());
|
||||
this.currentItem.set('pass', Ext.util.base64.encode(this.pass.getValue()));
|
||||
this.currentItem.set('calendar', this.calendar.getValue());
|
||||
this.currentItem.set('calendarname', Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(this.calendar.getValue()).display_name);
|
||||
}
|
||||
this.dialog.close();
|
||||
}
|
||||
},
|
||||
}
|
||||
this.dialog.close();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will create panel items for {@link Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel CalSyncEditPanel}
|
||||
* @return {Array} array of items that should be added to panel.
|
||||
* @private
|
||||
*/
|
||||
createPanelItems : function(config)
|
||||
{
|
||||
var icsurl = "";
|
||||
var intervall = "15";
|
||||
var user = "";
|
||||
var pass = "";
|
||||
/**
|
||||
* Function will create panel items for {@link Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel CalSyncEditPanel}
|
||||
* @return {Array} array of items that should be added to panel.
|
||||
* @private
|
||||
*/
|
||||
createPanelItems: function (config) {
|
||||
var icsurl = "";
|
||||
var intervall = "15";
|
||||
var user = "";
|
||||
var pass = "";
|
||||
var calendarname = "";
|
||||
var calendar = Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByName(container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/default_calendar")).entryid;
|
||||
var calendar = Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByName(container.getSettingsModel().get("zarafa/v1/plugins/calendarimporter/default_calendar")).entryid;
|
||||
var myStore = Zarafa.plugins.calendarimporter.data.Actions.getAllCalendarFolders(true);
|
||||
|
||||
if(config.item){
|
||||
icsurl = config.item.get('icsurl');
|
||||
intervall = config.item.get('intervall');
|
||||
user = config.item.get('user');
|
||||
pass = Ext.util.base64.decode(config.item.get('pass'));
|
||||
calendar = config.item.get('calendar');
|
||||
if (config.item) {
|
||||
icsurl = config.item.get('icsurl');
|
||||
intervall = config.item.get('intervall');
|
||||
user = config.item.get('user');
|
||||
pass = Ext.util.base64.decode(config.item.get('pass'));
|
||||
calendar = config.item.get('calendar');
|
||||
calendarname = config.item.get('calendarname');
|
||||
}
|
||||
|
||||
|
||||
return [{
|
||||
xtype: 'fieldset',
|
||||
title: _('ICAL Information'),
|
||||
defaultType: 'textfield',
|
||||
layout: 'form',
|
||||
flex: 1,
|
||||
defaults: {
|
||||
anchor: '100%',
|
||||
flex: 1
|
||||
},
|
||||
items: [{
|
||||
fieldLabel: 'ICS Url',
|
||||
name: 'icsurl',
|
||||
ref: '../icsurl',
|
||||
value: icsurl,
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
xtype:'selectbox',
|
||||
fieldLabel: _('Destination Calendar'),
|
||||
name: 'calendar',
|
||||
ref: '../calendar',
|
||||
value: calendar,
|
||||
editable: false,
|
||||
store: myStore,
|
||||
mode: 'local',
|
||||
labelSeperator: ":",
|
||||
border: false,
|
||||
anchor: "100%",
|
||||
scope: this,
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
xtype:'numberfield',
|
||||
fieldLabel: _('Sync Intervall (minutes)'),
|
||||
name: 'intervall',
|
||||
ref: '../intervall',
|
||||
value: intervall,
|
||||
allowBlank: false
|
||||
}]
|
||||
},
|
||||
{
|
||||
xtype: 'fieldset',
|
||||
title: _('Authentication (optional)'),
|
||||
defaultType: 'textfield',
|
||||
layout: 'form',
|
||||
defaults: {
|
||||
anchor: '100%'
|
||||
},
|
||||
items: [{
|
||||
fieldLabel: _('Username'),
|
||||
name: 'user',
|
||||
ref: '../user',
|
||||
value: user,
|
||||
allowBlank: true
|
||||
},
|
||||
{
|
||||
fieldLabel: _('Password'),
|
||||
name: 'pass',
|
||||
ref: '../pass',
|
||||
value: pass,
|
||||
inputType: 'password',
|
||||
allowBlank: true
|
||||
}]
|
||||
}];
|
||||
},
|
||||
|
||||
/**
|
||||
* Java String.hashCode() implementation
|
||||
* @private
|
||||
*/
|
||||
hashCode : function(str){
|
||||
var hash = 0;
|
||||
var chr = 0;
|
||||
var i = 0;
|
||||
}
|
||||
|
||||
if (str.length == 0) return hash;
|
||||
for (i = 0; i < str.length; i++) {
|
||||
chr = str.charCodeAt(i);
|
||||
hash = ((hash<<5)-hash)+chr;
|
||||
hash = hash & hash; // Convert to 32bit integer
|
||||
}
|
||||
return Math.abs(hash);
|
||||
}
|
||||
|
||||
return [{
|
||||
xtype: 'fieldset',
|
||||
title: dgettext('plugin_calendarimporter', 'ICAL Information'),
|
||||
defaultType: 'textfield',
|
||||
layout: 'form',
|
||||
flex: 1,
|
||||
defaults: {
|
||||
anchor: '100%',
|
||||
flex: 1
|
||||
},
|
||||
items: [{
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'ICS Url'),
|
||||
name: 'icsurl',
|
||||
ref: '../icsurl',
|
||||
value: icsurl,
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
xtype: 'selectbox',
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Destination Calendar'),
|
||||
name: 'calendar',
|
||||
ref: '../calendar',
|
||||
value: calendar,
|
||||
editable: false,
|
||||
store: myStore,
|
||||
mode: 'local',
|
||||
labelSeperator: ":",
|
||||
border: false,
|
||||
anchor: "100%",
|
||||
scope: this,
|
||||
allowBlank: false
|
||||
},
|
||||
{
|
||||
xtype: 'numberfield',
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Sync Intervall (minutes)'),
|
||||
name: 'intervall',
|
||||
ref: '../intervall',
|
||||
value: intervall,
|
||||
allowBlank: false
|
||||
}]
|
||||
},
|
||||
{
|
||||
xtype: 'fieldset',
|
||||
title: dgettext('plugin_calendarimporter', 'Authentication (optional)'),
|
||||
defaultType: 'textfield',
|
||||
layout: 'form',
|
||||
defaults: {
|
||||
anchor: '100%'
|
||||
},
|
||||
items: [{
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Username'),
|
||||
name: 'user',
|
||||
ref: '../user',
|
||||
value: user,
|
||||
allowBlank: true
|
||||
},
|
||||
{
|
||||
fieldLabel: dgettext('plugin_calendarimporter', 'Password'),
|
||||
name: 'pass',
|
||||
ref: '../pass',
|
||||
value: pass,
|
||||
inputType: 'password',
|
||||
allowBlank: true
|
||||
}]
|
||||
}];
|
||||
},
|
||||
|
||||
/**
|
||||
* Java String.hashCode() implementation
|
||||
* @private
|
||||
*/
|
||||
hashCode: function (str) {
|
||||
var hash = 0;
|
||||
var chr = 0;
|
||||
var i = 0;
|
||||
|
||||
if (str.length == 0) return hash;
|
||||
for (i = 0; i < str.length; i++) {
|
||||
chr = str.charCodeAt(i);
|
||||
hash = ((hash << 5) - hash) + chr;
|
||||
hash = hash & hash; // Convert to 32bit integer
|
||||
}
|
||||
return Math.abs(hash);
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.calsynceditpanel', Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel);
|
||||
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* CalSyncGrid.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter.settings.ui');
|
||||
|
||||
/**
|
||||
@@ -7,162 +29,152 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings.ui');
|
||||
*
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid = Ext.extend(Ext.grid.GridPanel, {
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration structure
|
||||
*/
|
||||
constructor : function(config)
|
||||
{
|
||||
config = config || {};
|
||||
|
||||
Ext.applyIf(config, {
|
||||
xtype : 'calendarimporter.calsyncgrid',
|
||||
border : true,
|
||||
store : config.store,
|
||||
viewConfig : {
|
||||
forceFit : true,
|
||||
emptyText : '<div class=\'emptytext\'>' + _('No ICAL sync entry exists') + '</div>'
|
||||
},
|
||||
loadMask : this.initLoadMask(),
|
||||
columns : this.initColumnModel(),
|
||||
selModel : this.initSelectionModel(),
|
||||
listeners : {
|
||||
viewready : this.onViewReady,
|
||||
rowdblclick : this.onRowDblClick,
|
||||
scope : this
|
||||
}
|
||||
});
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid.superclass.constructor.call(this, config);
|
||||
},
|
||||
Ext.applyIf(config, {
|
||||
xtype: 'calendarimporter.calsyncgrid',
|
||||
border: true,
|
||||
store: config.store,
|
||||
viewConfig: {
|
||||
forceFit: true,
|
||||
emptyText: '<div class=\'emptytext\'>' + dgettext('plugin_calendarimporter', 'No ICAL sync entry exists') + '</div>'
|
||||
},
|
||||
loadMask: this.initLoadMask(),
|
||||
columns: this.initColumnModel(),
|
||||
selModel: this.initSelectionModel(),
|
||||
listeners: {
|
||||
viewready: this.onViewReady,
|
||||
rowdblclick: this.onRowDblClick,
|
||||
scope: this
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* initialize events for the grid panel.
|
||||
* @private
|
||||
*/
|
||||
initEvents : function()
|
||||
{
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid.superclass.initEvents.call(this);
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
// select first icssync when store has finished loading
|
||||
this.mon(this.store, 'load', this.onViewReady, this, {single : true});
|
||||
},
|
||||
|
||||
/**
|
||||
* Render function
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
renderAuthColumn : function(value, p, record)
|
||||
{
|
||||
return value ? "true" : "false";
|
||||
},
|
||||
/**
|
||||
* initialize events for the grid panel.
|
||||
* @private
|
||||
*/
|
||||
initEvents: function () {
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid.superclass.initEvents.call(this);
|
||||
|
||||
/**
|
||||
* Render function
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
renderCalendarColumn : function(value, p, record)
|
||||
{
|
||||
return Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(value).display_name;
|
||||
},
|
||||
// select first icssync when store has finished loading
|
||||
this.mon(this.store, 'load', this.onViewReady, this, {single: true});
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a column model object, used in {@link #colModel} config
|
||||
* @return {Ext.grid.ColumnModel} column model object
|
||||
* @private
|
||||
*/
|
||||
initColumnModel : function()
|
||||
{
|
||||
return [{
|
||||
dataIndex : 'icsurl',
|
||||
header : _('ICS File'),
|
||||
renderer : Zarafa.common.ui.grid.Renderers.text
|
||||
},
|
||||
{
|
||||
dataIndex : 'calendarname',
|
||||
header : _('Destination Calender'),
|
||||
renderer : Zarafa.common.ui.grid.Renderers.text
|
||||
},
|
||||
{
|
||||
dataIndex : 'user',
|
||||
header : _('Authentication'),
|
||||
renderer : this.renderAuthColumn
|
||||
},
|
||||
{
|
||||
dataIndex : 'intervall',
|
||||
header : _('Sync Intervall')
|
||||
},
|
||||
{
|
||||
dataIndex : 'lastsync',
|
||||
header : _('Last Synchronisation'),
|
||||
renderer : Zarafa.common.ui.grid.Renderers.text
|
||||
}]
|
||||
},
|
||||
/**
|
||||
* Render function
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
renderAuthColumn: function (value, p, record) {
|
||||
return value ? "true" : "false";
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a selection model object, used in {@link #selModel} config
|
||||
* @return {Ext.grid.RowSelectionModel} selection model object
|
||||
* @private
|
||||
*/
|
||||
initSelectionModel : function()
|
||||
{
|
||||
return new Ext.grid.RowSelectionModel({
|
||||
singleSelect : true
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Render function
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
renderCalendarColumn: function (value, p, record) {
|
||||
return Zarafa.plugins.calendarimporter.data.Actions.getCalendarFolderByEntryid(value).display_name;
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize the {@link Ext.grid.GridPanel.loadMask} field
|
||||
*
|
||||
* @return {Ext.LoadMask} The configuration object for {@link Ext.LoadMask}
|
||||
* @private
|
||||
*/
|
||||
initLoadMask : function()
|
||||
{
|
||||
return {
|
||||
msg : _('Loading ics sync entries') + '...'
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Creates a column model object, used in {@link #colModel} config
|
||||
* @return {Ext.grid.ColumnModel} column model object
|
||||
* @private
|
||||
*/
|
||||
initColumnModel: function () {
|
||||
return [{
|
||||
dataIndex: 'icsurl',
|
||||
header: dgettext('plugin_calendarimporter', 'ICS File'),
|
||||
renderer: Zarafa.common.ui.grid.Renderers.text
|
||||
},
|
||||
{
|
||||
dataIndex: 'calendarname',
|
||||
header: dgettext('plugin_calendarimporter', 'Destination Calender'),
|
||||
renderer: Zarafa.common.ui.grid.Renderers.text
|
||||
},
|
||||
{
|
||||
dataIndex: 'user',
|
||||
header: dgettext('plugin_calendarimporter', 'Authentication'),
|
||||
renderer: this.renderAuthColumn
|
||||
},
|
||||
{
|
||||
dataIndex: 'intervall',
|
||||
header: dgettext('plugin_calendarimporter', 'Sync Intervall')
|
||||
},
|
||||
{
|
||||
dataIndex: 'lastsync',
|
||||
header: dgettext('plugin_calendarimporter', 'Last Synchronisation'),
|
||||
renderer: Zarafa.common.ui.grid.Renderers.text
|
||||
}]
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler which is fired when the gridPanel is ready. This will automatically
|
||||
* select the first row in the grid.
|
||||
* @private
|
||||
*/
|
||||
onViewReady : function()
|
||||
{
|
||||
this.getSelectionModel().selectFirstRow();
|
||||
},
|
||||
/**
|
||||
* Creates a selection model object, used in {@link #selModel} config
|
||||
* @return {Ext.grid.RowSelectionModel} selection model object
|
||||
* @private
|
||||
*/
|
||||
initSelectionModel: function () {
|
||||
return new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will be called to remove a ics sync entry.
|
||||
*/
|
||||
removeIcsSyncAs : function()
|
||||
{
|
||||
var icsRecord = this.getSelectionModel().getSelected();
|
||||
if(!icsRecord) {
|
||||
Ext.Msg.alert(_('Alert'), _('Please select a ics sync entry.'));
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Initialize the {@link Ext.grid.GridPanel.loadMask} field
|
||||
*
|
||||
* @return {Ext.LoadMask} The configuration object for {@link Ext.LoadMask}
|
||||
* @private
|
||||
*/
|
||||
initLoadMask: function () {
|
||||
return {
|
||||
msg: dgettext('plugin_calendarimporter', 'Loading ics sync entries...')
|
||||
};
|
||||
},
|
||||
|
||||
this.store.remove(icsRecord);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler which is fired when the {@link Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid CalSyncGrid} is double clicked.
|
||||
* it will call generic function to handle the functionality.
|
||||
* @private
|
||||
*/
|
||||
onRowDblClick : function(grid, rowIndex)
|
||||
{
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit'], undefined, {
|
||||
store : grid.getStore(),
|
||||
item : grid.getStore().getAt(rowIndex),
|
||||
manager : Ext.WindowMgr
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Event handler which is fired when the gridPanel is ready. This will automatically
|
||||
* select the first row in the grid.
|
||||
* @private
|
||||
*/
|
||||
onViewReady: function () {
|
||||
this.getSelectionModel().selectFirstRow();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will be called to remove a ics sync entry.
|
||||
*/
|
||||
removeIcsSyncAs: function () {
|
||||
var icsRecord = this.getSelectionModel().getSelected();
|
||||
if (!icsRecord) {
|
||||
Ext.Msg.alert(dgettext('plugin_calendarimporter', 'Alert'), dgettext('plugin_calendarimporter', 'Please select a ics sync entry.'));
|
||||
return;
|
||||
}
|
||||
|
||||
this.store.remove(icsRecord);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler which is fired when the {@link Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid CalSyncGrid} is double clicked.
|
||||
* it will call generic function to handle the functionality.
|
||||
* @private
|
||||
*/
|
||||
onRowDblClick: function (grid, rowIndex) {
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit'], undefined, {
|
||||
store: grid.getStore(),
|
||||
item: grid.getStore().getAt(rowIndex),
|
||||
manager: Ext.WindowMgr
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.calsyncgrid', Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid);
|
||||
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* CalSyncPanel.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
Ext.namespace('Zarafa.plugins.calendarimporter.settings.ui');
|
||||
|
||||
/**
|
||||
@@ -8,151 +30,143 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings.ui');
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel = Ext.extend(Ext.Panel, {
|
||||
|
||||
// store
|
||||
store : undefined,
|
||||
// store
|
||||
store: undefined,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor : function(config)
|
||||
{
|
||||
config = config || {};
|
||||
if(config.store)
|
||||
this.store = config.store;
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
if (config.store)
|
||||
this.store = config.store;
|
||||
|
||||
Ext.applyIf(config, {
|
||||
// Override from Ext.Component
|
||||
xtype : 'calendarimporter.calsyncpanel',
|
||||
border : false,
|
||||
layout : {
|
||||
type : 'vbox',
|
||||
align : 'stretch',
|
||||
pack : 'start'
|
||||
},
|
||||
items : this.createPanelItems(this.store)
|
||||
});
|
||||
Ext.applyIf(config, {
|
||||
// Override from Ext.Component
|
||||
xtype: 'calendarimporter.calsyncpanel',
|
||||
border: false,
|
||||
layout: {
|
||||
type: 'vbox',
|
||||
align: 'stretch',
|
||||
pack: 'start'
|
||||
},
|
||||
items: this.createPanelItems(this.store)
|
||||
});
|
||||
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will create panel items for {@link Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel CalSyncPanel}
|
||||
* @return {Array} array of items that should be added to panel.
|
||||
* @private
|
||||
*/
|
||||
createPanelItems : function(store)
|
||||
{
|
||||
return [{
|
||||
xtype : 'displayfield',
|
||||
value : _('Setup calendars you want to subscribe to.'),
|
||||
fieldClass : 'x-form-display-field'
|
||||
}, {
|
||||
xtype : 'container',
|
||||
flex : 1,
|
||||
layout : {
|
||||
type : 'hbox',
|
||||
align : 'stretch',
|
||||
pack : 'start'
|
||||
},
|
||||
items : [{
|
||||
xtype : 'calendarimporter.calsyncgrid',
|
||||
ref : '../calsyncGrid',
|
||||
store : store,
|
||||
flex : 1
|
||||
}, {
|
||||
xtype : 'container',
|
||||
width : 160,
|
||||
defaults : {
|
||||
width : 140
|
||||
},
|
||||
layout : {
|
||||
type : 'vbox',
|
||||
align : 'center',
|
||||
pack : 'start'
|
||||
},
|
||||
items : [{
|
||||
xtype : 'button',
|
||||
text : _('Add') + '...',
|
||||
handler : this.onCalSyncAdd,
|
||||
ref : '../../addButton',
|
||||
scope : this
|
||||
}, {
|
||||
xtype : 'spacer',
|
||||
height : 20
|
||||
}, {
|
||||
xtype : 'button',
|
||||
text : _('Remove') + '...',
|
||||
disabled : true,
|
||||
ref : '../../removeButton',
|
||||
handler : this.onCalSyncRemove,
|
||||
scope : this
|
||||
}]
|
||||
}]
|
||||
}];
|
||||
},
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* initialize events for the panel.
|
||||
* @private
|
||||
*/
|
||||
initEvents : function()
|
||||
{
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel.superclass.initEvents.call(this);
|
||||
/**
|
||||
* Function will create panel items for {@link Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel CalSyncPanel}
|
||||
* @return {Array} array of items that should be added to panel.
|
||||
* @private
|
||||
*/
|
||||
createPanelItems: function (store) {
|
||||
return [{
|
||||
xtype: 'displayfield',
|
||||
value: dgettext('plugin_calendarimporter', 'Setup calendars you want to subscribe to.'),
|
||||
fieldClass: 'x-form-display-field'
|
||||
}, {
|
||||
xtype: 'container',
|
||||
flex: 1,
|
||||
layout: {
|
||||
type: 'hbox',
|
||||
align: 'stretch',
|
||||
pack: 'start'
|
||||
},
|
||||
items: [{
|
||||
xtype: 'calendarimporter.calsyncgrid',
|
||||
ref: '../calsyncGrid',
|
||||
store: store,
|
||||
flex: 1
|
||||
}, {
|
||||
xtype: 'container',
|
||||
width: 160,
|
||||
defaults: {
|
||||
width: 140
|
||||
},
|
||||
layout: {
|
||||
type: 'vbox',
|
||||
align: 'center',
|
||||
pack: 'start'
|
||||
},
|
||||
items: [{
|
||||
xtype: 'button',
|
||||
text: _('Add') + '...',
|
||||
handler: this.onCalSyncAdd,
|
||||
ref: '../../addButton',
|
||||
scope: this
|
||||
}, {
|
||||
xtype: 'spacer',
|
||||
height: 20
|
||||
}, {
|
||||
xtype: 'button',
|
||||
text: _('Remove') + '...',
|
||||
disabled: true,
|
||||
ref: '../../removeButton',
|
||||
handler: this.onCalSyncRemove,
|
||||
scope: this
|
||||
}]
|
||||
}]
|
||||
}];
|
||||
},
|
||||
|
||||
// register event to enable/disable buttons
|
||||
this.mon(this.calsyncGrid.getSelectionModel(), 'selectionchange', this.onGridSelectionChange, this);
|
||||
},
|
||||
/**
|
||||
* initialize events for the panel.
|
||||
* @private
|
||||
*/
|
||||
initEvents: function () {
|
||||
Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel.superclass.initEvents.call(this);
|
||||
|
||||
/**
|
||||
* Handler function will be called when user clicks on 'Add' button.
|
||||
* @private
|
||||
*/
|
||||
onCalSyncAdd : function()
|
||||
{
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit'], undefined, {
|
||||
store : this.store,
|
||||
item : undefined,
|
||||
manager : Ext.WindowMgr
|
||||
});
|
||||
},
|
||||
// register event to enable/disable buttons
|
||||
this.mon(this.calsyncGrid.getSelectionModel(), 'selectionchange', this.onGridSelectionChange, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler will be called when selection in {@link Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid CalSyncGrid}
|
||||
* has been changed
|
||||
* @param {Ext.grid.RowSelectionModel} selectionModel selection model that fired the event
|
||||
*/
|
||||
onGridSelectionChange : function(selectionModel)
|
||||
{
|
||||
var noSelection = (selectionModel.hasSelection() === false);
|
||||
/**
|
||||
* Handler function will be called when user clicks on 'Add' button.
|
||||
* @private
|
||||
*/
|
||||
onCalSyncAdd: function () {
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit'], undefined, {
|
||||
store: this.store,
|
||||
item: undefined,
|
||||
manager: Ext.WindowMgr
|
||||
});
|
||||
},
|
||||
|
||||
this.removeButton.setDisabled(noSelection);
|
||||
},
|
||||
/**
|
||||
* Event handler will be called when selection in {@link Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid CalSyncGrid}
|
||||
* has been changed
|
||||
* @param {Ext.grid.RowSelectionModel} selectionModel selection model that fired the event
|
||||
*/
|
||||
onGridSelectionChange: function (selectionModel) {
|
||||
var noSelection = (selectionModel.hasSelection() === false);
|
||||
|
||||
/**
|
||||
* Handler function will be called when user clicks on 'Remove' button.
|
||||
* @private
|
||||
*/
|
||||
onCalSyncRemove : function()
|
||||
{
|
||||
this.calsyncGrid.removeIcsSyncAs();
|
||||
},
|
||||
this.removeButton.setDisabled(noSelection);
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will be used to reload data in the store.
|
||||
*/
|
||||
discardChanges : function()
|
||||
{
|
||||
this.store.load();
|
||||
},
|
||||
/**
|
||||
* Handler function will be called when user clicks on 'Remove' button.
|
||||
* @private
|
||||
*/
|
||||
onCalSyncRemove: function () {
|
||||
this.calsyncGrid.removeIcsSyncAs();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will be used to save changes in the store.
|
||||
*/
|
||||
saveChanges : function()
|
||||
{
|
||||
this.store.save();
|
||||
}
|
||||
/**
|
||||
* Function will be used to reload data in the store.
|
||||
*/
|
||||
discardChanges: function () {
|
||||
this.store.load();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function will be used to save changes in the store.
|
||||
*/
|
||||
saveChanges: function () {
|
||||
this.store.save();
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.calsyncpanel', Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ContectMenu.js zarafa calender to ics im/exporter
|
||||
* ContectMenu.js, Kopano calender to ics im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -29,101 +29,105 @@ Ext.namespace('Zarafa.plugins.calendarimporter.ui');
|
||||
*/
|
||||
Zarafa.plugins.calendarimporter.ui.ContextMenu = Ext.extend(Zarafa.hierarchy.ui.ContextMenu, {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} config Configuration object
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
|
||||
if (config.contextNode) {
|
||||
config.contextTree = config.contextNode.getOwnerTree();
|
||||
}
|
||||
if (config.contextNode) {
|
||||
config.contextTree = config.contextNode.getOwnerTree();
|
||||
}
|
||||
|
||||
Zarafa.plugins.calendarimporter.ui.ContextMenu.superclass.constructor.call(this, config);
|
||||
Zarafa.plugins.calendarimporter.ui.ContextMenu.superclass.constructor.call(this, config);
|
||||
|
||||
// add item to menu
|
||||
var additionalItems = this.createAdditionalContextMenuItems(config);
|
||||
for (var i = 0; i < additionalItems.length; i++) {
|
||||
config.items[0].push(additionalItems[i]);
|
||||
}
|
||||
// add item to menu
|
||||
var additionalItems = this.createAdditionalContextMenuItems(config);
|
||||
for (var i = 0; i < additionalItems.length; i++) {
|
||||
config.items[0].push(additionalItems[i]);
|
||||
}
|
||||
|
||||
Zarafa.plugins.calendarimporter.ui.ContextMenu.superclass.constructor.call(this, config); // redo ... otherwise menu does not get published
|
||||
},
|
||||
Zarafa.plugins.calendarimporter.ui.ContextMenu.superclass.constructor.call(this, config); // redo ... otherwise menu does not get published
|
||||
},
|
||||
|
||||
/**
|
||||
* Create the Action context menu items.
|
||||
* @param {Object} config Configuration object for the {@link Zarafa.plugins.calendarimporter.ui.ContextMenu ContextMenu}
|
||||
* @return {Zarafa.core.ui.menu.ConditionalItem[]} The list of Action context menu items
|
||||
* @private
|
||||
*
|
||||
* Note: All handlers are called within the scope of {@link Zarafa.plugins.calendarimporter.ui.ContextMenu HierarchyContextMenu}
|
||||
*/
|
||||
createAdditionalContextMenuItems: function (config) {
|
||||
return [{
|
||||
xtype: 'menuseparator'
|
||||
}, {
|
||||
text : _('Import Calendar'),
|
||||
iconCls : 'icon_calendarimporter_import',
|
||||
handler : this.onContextItemImport,
|
||||
beforeShow: function (item, record) {
|
||||
var access = record.get('access') & Zarafa.core.mapi.Access.ACCESS_MODIFY;
|
||||
if (!access || (record.isIPMSubTree() && !record.getMAPIStore().isDefaultStore())) {
|
||||
item.setDisabled(true);
|
||||
} else {
|
||||
item.setDisabled(false);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
text : _('Export Calendar'),
|
||||
iconCls : 'icon_calendarimporter_export',
|
||||
handler : this.onContextItemExport,
|
||||
beforeShow: function (item, record) {
|
||||
var access = record.get('access') & Zarafa.core.mapi.Access.ACCESS_READ;
|
||||
if (!access || (record.isIPMSubTree() && !record.getMAPIStore().isDefaultStore())) {
|
||||
item.setDisabled(true);
|
||||
} else {
|
||||
item.setDisabled(false);
|
||||
}
|
||||
}
|
||||
}];
|
||||
},
|
||||
/**
|
||||
* Create the Action context menu items.
|
||||
* @param {Object} config Configuration object for the {@link Zarafa.plugins.calendarimporter.ui.ContextMenu ContextMenu}
|
||||
* @return {Zarafa.core.ui.menu.ConditionalItem[]} The list of Action context menu items
|
||||
* @private
|
||||
*
|
||||
* Note: All handlers are called within the scope of {@link Zarafa.plugins.calendarimporter.ui.ContextMenu HierarchyContextMenu}
|
||||
*/
|
||||
createAdditionalContextMenuItems: function (config) {
|
||||
return [{
|
||||
xtype: 'menuseparator'
|
||||
}, {
|
||||
text: dgettext('plugin_calendarimporter', 'Import Calendar'),
|
||||
iconCls: 'icon_calendarimporter_import',
|
||||
handler: this.onContextItemImport,
|
||||
beforeShow: function (item, record) {
|
||||
var access = record.get('access') & Zarafa.core.mapi.Access.ACCESS_MODIFY;
|
||||
if (!access || (record.isIPMSubTree() && !record.getMAPIStore().isDefaultStore())) {
|
||||
item.setDisabled(true);
|
||||
} else {
|
||||
item.setDisabled(false);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
text: dgettext('plugin_calendarimporter', 'Export Calendar'),
|
||||
iconCls: 'icon_calendarimporter_export',
|
||||
handler: this.onContextItemExport,
|
||||
beforeShow: function (item, record) {
|
||||
var access = record.get('access') & Zarafa.core.mapi.Access.ACCESS_READ;
|
||||
if (!access || (record.isIPMSubTree() && !record.getMAPIStore().isDefaultStore())) {
|
||||
item.setDisabled(true);
|
||||
} else {
|
||||
item.setDisabled(false);
|
||||
}
|
||||
}
|
||||
}];
|
||||
},
|
||||
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.calendarimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemExport: function () {
|
||||
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
|
||||
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS,
|
||||
scope : this
|
||||
});
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.calendarimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemExport: function () {
|
||||
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
|
||||
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS,
|
||||
scope: this
|
||||
});
|
||||
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'calendarmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: this.records.get("store_entryid"),
|
||||
folder : this.records.get("entryid")
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
// Notify user
|
||||
// # TRANSLATORS: {0} will be replaced by the number of contacts that will be exported
|
||||
container.getNotifier().notify('info', dgettext('plugin_contactimporter', 'Calendar Export'), String.format(dgettext('plugin_calendarimporter', 'Exporting {0} events. Please wait...'), this.records.get('content_count')));
|
||||
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.calendarimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemImport: function () {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents'];
|
||||
var config = {
|
||||
modal : true,
|
||||
folder: this.records.get("entryid")
|
||||
};
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'calendarmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: this.records.get("store_entryid"),
|
||||
folder: this.records.get("entryid")
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
}
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.calendarimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemImport: function () {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.calendarimporter.dialogs.importevents'];
|
||||
var config = {
|
||||
modal: true,
|
||||
folder: this.records.get("entryid")
|
||||
};
|
||||
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('calendarimporter.hierarchycontextmenu', Zarafa.plugins.calendarimporter.ui.ContextMenu);
|
Reference in New Issue
Block a user