calendarexporter: TODO: write new list module, ics creation improvements

This commit is contained in:
2012-12-06 23:10:23 +00:00
parent 76c2f9192a
commit 8f9248aaff
5 changed files with 153 additions and 11 deletions

View File

@@ -22,6 +22,15 @@ Zarafa.plugins.calendarimporter.data.ResponseHandler = Ext.extend(Zarafa.core.da
this.successCallback(response);
},
/**
* Call the successCallback callback function.
* @param {Object} response Object contained the response data.
*/
doList : function(response)
{
this.successCallback(response);
},
/**
* In case exception happened on server, server will return
* exception response with the code of exception.

View File

@@ -395,11 +395,18 @@ Zarafa.plugins.calendarimporter.dialogs.ImportPanel = Ext.extend(Ext.form.FormPa
});
container.getRequest().singleRequest(
'calendarexportermodule',
'export',
'appointmentlistmodule',
'list',
{
calFolder : calValue,
calIndex : selIndex,
groupDir: "ASC",
restriction: {
startdate: 0,
duedate: 2145826800 // 2037... highest unix timestamp
},
sort: [{
"field": "startdate",
"direction": "DESC"
}],
store_entryid : calendarFolder.data.store_entryid,
entryid : calendarFolder.data.entryid
},
@@ -415,13 +422,41 @@ Zarafa.plugins.calendarimporter.dialogs.ImportPanel = Ext.extend(Ext.form.FormPa
*/
exportDone : function(response)
{
if(response.status === true) {
container.getNotifier().notify('info', 'Exported', 'Exported ' + response.entries + ' entries');
if(response.item.length > 0) {
// call export function here!
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
successCallback: this.downLoadICS.createDelegate(this)
});
container.getRequest().singleRequest(
'calendarexportermodule',
'export',
{
data: response,
calendar: this.calendarselector.value
},
responseHandler
);
container.getNotifier().notify('info', 'Exported', 'Exported ' + response.item.length + ' entries');
} else {
container.getNotifier().notify('error', 'Export Failed', 'Failed to export your calendar');
container.getNotifier().notify('info', 'Export Failed', 'There were no items to export!');
}
this.dialog.close();
},
/**
* download ics file =)
* @param {Object} response
* @private
*/
downLoadICS : function(response)
{
if(response.status === true) {
document.location.href = 'plugins/calendarimporter/php/download.php?fileid='+response.fileid+'&basedir='+response.basedir+'&secid='+response.secid+'&realname='+response.realname;
} else {
container.getNotifier().notify('error', 'Export Failed', 'ICal File creation failed!');
}
},
importCheckedEvents: function () {
//receive existing calendar store

View File

@@ -1,6 +1,6 @@
Ext.namespace("Zarafa.plugins.calendarimporter"); // Assign the right namespace
Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, { // create new import plugin
Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, { // create new import plugin
/**
* @constructor