tmp commit

This commit is contained in:
Christoph Haas 2013-08-25 13:47:49 +00:00
parent fbe6a184f4
commit 4065607f40
11 changed files with 130 additions and 45 deletions

View File

@ -1,6 +1,6 @@
<project default="all">
<!--############# CONFIGURE ALL PROPERTIES FOR THE REPLACER HERE ################-->
<property name="plugin_version" value="2.0.3"/>
<property name="plugin_version" value="2.0.4"/>
<!-- EOC -->
<property name="root-folder" value="${basedir}/../"/>
@ -102,6 +102,11 @@
<fileset file="js/data/ResponseHandler.js" />
<fileset file="js/dialogs/ImportContentPanel.js" />
<fileset file="js/dialogs/ImportPanel.js" />
<fileset file="js/settings/SettingsCalSyncWidget.js" />
<fileset file="js/settings/ui/CalSyncPanel.js" />
<fileset file="js/settings/ui/CalSyncGrid.js" />
<fileset file="js/settings/dialogs/CalSyncEditContentPanel.js" />
<fileset file="js/settings/dialogs/CalSyncEditPanel.js" />
</concat>
</then>
</if>

View File

@ -1,3 +1,6 @@
calendarimporter 2.0.3:
- added sync support for ics files
calendarimporter 2.0.3:
- fixed all day events

View File

@ -3,6 +3,8 @@
define('PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE', false);
/** Disable the export feature for all clients */
define('PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE_EXPORT', false);
/** Disable the sync feature for all clients */
define('PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE_SYNC', true);
/** The default calendar to import to*/
define('PLUGIN_CALENDARIMPORTER_DEFAULT', "calendar");

View File

@ -50,8 +50,8 @@ Zarafa.plugins.calendarimporter.dialogs.ImportContentPanel = Ext.extend(Zarafa.c
layout : 'fit',
title : title,
closeOnSave : true,
width : 620,
height : 465,
width : 800,
height : 700,
//Add panel
items : [
{

View File

@ -55,6 +55,14 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
this.registerInsertionPoint('common.contextmenu.attachment.actions', this.createAttachmentImportButton);
/* add import button to south navigation */
this.registerInsertionPoint("navigation.south", this.createImportButton, 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');
/* enable the settings widget */
this.registerInsertionPoint('context.settings.category.calendar', this.createSettingsWidget);
}
},
/**
@ -82,6 +90,18 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
return button;
},
/**
* Creates the button
*
* @return {Object} Configuration object for a {@link Ext.Button button}
*
*/
createSettingsWidget: function () {
return [{
xtype : 'calendarimporter.settingscalsyncwidget'
}];
},
/**
* Insert import button in all attachment suggestions
@ -208,6 +228,9 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
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;
}
return bid;
},
@ -225,6 +248,9 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
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;
}
return component;
@ -232,7 +258,7 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
});
/*############################################################################################################################
/*############################################################################################################################*
* STARTUP
*############################################################################################################################*/
Zarafa.onReady(function() {

View File

@ -5,10 +5,8 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings');
* @extends Zarafa.settings.ui.SettingsWidget
* @xtype calendarimporter.settingscalsyncwidget
*
* The {@link Zarafa.settings.ui.SettingsWidget widget} for configuring
* delegation options in the {@link Zarafa.common.settings.SettingsSendAsCategory sendas category}.
*/
Zarafa.common.settings.SettingsSendAsWidget = Ext.extend(Zarafa.settings.ui.SettingsWidget, {
Zarafa.plugins.calendarimporter.settings.SettingsCalSyncWidget = Ext.extend(Zarafa.settings.ui.SettingsWidget, {
/**
* @cfg {Zarafa.settings.SettingsContext} settingsContext
*/
@ -91,17 +89,20 @@ Zarafa.common.settings.SettingsSendAsWidget = Ext.extend(Zarafa.settings.ui.Sett
// Start reading the Grid store and convert the contents back into
// an object which can be pushed to the settings.
var icslinks = this.sendasPanel.sendasGrid.getStore().getRange();
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')] = {
'display_name' : icslink.get('display_name'),
'email_address' : icslink.get('email_address')
'icsurl' : icslink.get('icsurl'),
'intervall' : icslink.get('intervall'),
'user' : icslink.get('user'),
'pass' : icslink.get('pass'),
'lastsync' : icslink.get('lastsync')
};
}
settingsModel.set('zarafa/v1/contexts/mail/sendas', icslinkData);
settingsModel.set('zarafa/v1/contexts/calendar/icssync', icslinkData);
settingsModel.endEdit();
}

View File

@ -61,11 +61,15 @@ Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel = Ext.extend(E
var id = 0;
var record = undefined;
console.log(this);
if(!this.currentItem) {
record = new store.recordType({
id: this.hashCode(this.icsurl.getValue()),
display_name: this.display_name.getValue(),
icsurl: this.icsurl.getValue()
icsurl: this.icsurl.getValue(),
intervall: this.intervall.getValue(),
user: this.user.getValue(),
pass: this.pass.getValue(),
lastsync: 0
});
}
@ -73,43 +77,83 @@ Zarafa.plugins.calendarimporter.settings.dialogs.CalSyncEditPanel = Ext.extend(E
if(record) {
store.add(record);
} else {
this.currentItem.set('display_name', this.display_name.getValue());
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', this.pass.getValue());
}
this.dialog.close();
}
},
/**
* Function will create panel items for {@link Zarafa.common.sendas.dialogs.SendAsEditPanel SendAsEditPanel}
* 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 displayName = "";
var icsUrl = "";
var icsurl = "";
var intervall = "";
var user = "";
var pass = "";
if(config.item){
displayName = config.item.get('display_name');
icsUrl = config.item.get('icsurl');
icsurl = config.item.get('icsurl');
intervall = config.item.get('intervall');
user = config.item.get('user');
pass = config.item.get('pass');
}
return [{
fieldLabel: _('Display Name'),
name: 'display_name',
ref: 'display_name',
value: displayName,
anchor: '100%'
xtype: 'fieldset',
title: _('ICAL Information'),
defaultType: 'textfield',
labelWidth: 120,
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
fieldLabel: _('ICS Url'),
name: 'icsurl',
ref: '../icsurl',
value: icsurl,
allowBlank: false
},
{
xtype:'numberfield',
fieldLabel: _('Sync Intervall'),
name: 'intervall',
ref: '../intervall',
value: intervall,
allowBlank: false
}]
},
{
fieldLabel: _('ICS Url'),
name: 'icsurl',
ref: 'icsurl',
allowBlank: false,
value: icsUrl,
vtype:'email',
anchor: '100%'
xtype: 'fieldset',
title: _('Authentication (optional)'),
defaultType: 'textfield',
labelWidth: 120,
layout: 'anchor',
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
}]
}];
},

View File

@ -5,8 +5,6 @@ Ext.namespace('Zarafa.plugins.calendarimporter.settings.ui');
* @extends Ext.grid.GridPanel
* @xtype calendarimporter.calsyncgrid
*
* {@link Zarafa.common.sendas.ui.SendAsGrid SendAsGrid} will be used to display
* sendas of the current user.
*/
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid = Ext.extend(Ext.grid.GridPanel, {
/**
@ -18,7 +16,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid = Ext.extend(Ext.grid.Gr
config = config || {};
Ext.applyIf(config, {
xtype : 'calendarimporter.calsyncpanel',
xtype : 'calendarimporter.calsyncgrid',
border : true,
store : config.store,
viewConfig : {
@ -46,7 +44,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid = Ext.extend(Ext.grid.Gr
{
Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid.superclass.initEvents.call(this);
// select first sendas when store has finished loading
// select first icssync when store has finished loading
this.mon(this.store, 'load', this.onViewReady, this, {single : true});
},
@ -126,7 +124,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid = Ext.extend(Ext.grid.Gr
/**
* Function will be called to remove a ics sync entry.
*/
removeSendAs : function()
removeIcsSyncAs : function()
{
var icsRecord = this.getSelectionModel().getSelected();
if(!icsRecord) {
@ -152,4 +150,4 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid = Ext.extend(Ext.grid.Gr
}
});
Ext.reg('calendarimporter.calsyncpanel', Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid);
Ext.reg('calendarimporter.calsyncgrid', Zarafa.plugins.calendarimporter.settings.ui.CalSyncGrid);

View File

@ -45,7 +45,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel = Ext.extend(Ext.Panel,
{
return [{
xtype : 'displayfield',
value : _('Here you can .ics files that will be synchronised.'),
value : _('Here you can enter .ics files that will be synchronised.'),
fieldClass : 'x-form-display-field'
}, {
xtype : 'container',
@ -74,7 +74,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel = Ext.extend(Ext.Panel,
items : [{
xtype : 'button',
text : _('Add') + '...',
handler : this.onSendAsAdd,
handler : this.onCalSyncAdd,
ref : '../../addButton',
scope : this
}, {
@ -85,7 +85,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel = Ext.extend(Ext.Panel,
text : _('Remove') + '...',
disabled : true,
ref : '../../removeButton',
handler : this.onSendAsRemove,
handler : this.onCalSyncRemove,
scope : this
}]
}]
@ -108,7 +108,7 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel = Ext.extend(Ext.Panel,
* Handler function will be called when user clicks on 'Add' button.
* @private
*/
onSendAsAdd : function()
onCalSyncAdd : function()
{
Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType['plugins.calendarimporter.settings.dialogs.calsyncedit'], undefined, {
store : this.store,
@ -133,9 +133,9 @@ Zarafa.plugins.calendarimporter.settings.ui.CalSyncPanel = Ext.extend(Ext.Panel,
* Handler function will be called when user clicks on 'Remove' button.
* @private
*/
onSendAsRemove : function()
onCalSyncRemove : function()
{
this.sendasGrid.removeSendAs();
this.calsyncGrid.removeIcsSyncAs();
},
/**

View File

@ -28,6 +28,11 @@
<clientfile load="source">js/data/ResponseHandler.js</clientfile>
<clientfile load="source">js/dialogs/ImportContentPanel.js</clientfile>
<clientfile load="source">js/dialogs/ImportPanel.js</clientfile>
<clientfile load="source">js/dialogs/settings/SettingsCalSyncWidget.js</clientfile>
<clientfile load="source">js/dialogs/settings/ui/CalSyncGrid.js</clientfile>
<clientfile load="source">js/dialogs/settings/ui/CalSyncPanel.js</clientfile>
<clientfile load="source">js/dialogs/settings/dialogs/CalSyncEditContentPanel.js</clientfile>
<clientfile load="source">js/dialogs/settings/dialogs/CalSyncEditPanel.js</clientfile>
</client>
<resources>
<resourcefile load="release">resources/css/calendarimporter-min.css</resourcefile>

View File

@ -48,6 +48,7 @@ class Plugincalendarimporter extends Plugin {
'calendarimporter' => Array(
'enable' => PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE,
'enable_export' => PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE_EXPORT,
'enable_sync' => PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE_SYNC,
'default_calendar' => PLUGIN_CALENDARIMPORTER_DEFAULT,
'default_timezone' => PLUGIN_CALENDARIMPORTER_DEFAULT_TIMEZONE
)