JS Files translated to english
This commit is contained in:
38
js/ABOUT.js
38
js/ABOUT.js
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ABOUT.js zarafa contact to vcf im/exporter
|
||||
* ABOUT.js, Kopano Webapp contact to vcf im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -29,30 +29,30 @@ Ext.namespace('Zarafa.plugins.contactimporter');
|
||||
* The copyright string holding the copyright notice for the Zarafa contactimporter Plugin.
|
||||
*/
|
||||
Zarafa.plugins.contactimporter.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 contactimporter plugin contains the following third-party components:</p>"
|
||||
+ "<p>The contactimporter plugin contains the following third-party components:</p>"
|
||||
|
||||
+ "<h1>vCard-parser</h1>"
|
||||
+ "<h1>vCard-parser</h1>"
|
||||
|
||||
+ "<p>Copyright (C) 2016 Jeroen Desloovere</p>"
|
||||
+ "<p>Copyright (C) 2016 Jeroen Desloovere</p>"
|
||||
|
||||
+ "<p>Licensed under the MIT License.</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>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>"
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ResponseHandler.js zarafa contact im/exporter
|
||||
* ResponseHandler.js, Kopano Webapp contact to vcf im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -34,52 +34,52 @@ Ext.namespace('Zarafa.plugins.contactimporter.data');
|
||||
* Calendar specific response handler.
|
||||
*/
|
||||
Zarafa.plugins.contactimporter.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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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('contactimporter.contactresponsehandler', Zarafa.plugins.contactimporter.data.ResponseHandler);
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ImportContentPanel.js zarafa contact to vcf im/exporter
|
||||
* ImportContentPanel.js, Kopano Webapp contact to vcf im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -36,31 +36,31 @@ Ext.namespace("Zarafa.plugins.contactimporter.dialogs");
|
||||
*/
|
||||
Zarafa.plugins.contactimporter.dialogs.ImportContentPanel = Ext.extend(Zarafa.core.ui.ContentPanel, {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
var title = _('Import Contacts');
|
||||
Ext.applyIf(config, {
|
||||
layout : 'fit',
|
||||
title : title,
|
||||
closeOnSave: true,
|
||||
width : 620,
|
||||
height : 465,
|
||||
//Add panel
|
||||
items : [
|
||||
{
|
||||
xtype : 'contactimporter.importcontactpanel',
|
||||
filename: config.filename,
|
||||
folder : config.folder
|
||||
}
|
||||
]
|
||||
});
|
||||
/**
|
||||
* @constructor
|
||||
* @param config Configuration structure
|
||||
*/
|
||||
constructor: function (config) {
|
||||
config = config || {};
|
||||
var title = dgettext('plugin_contactimporter', 'Import Contacts');
|
||||
Ext.applyIf(config, {
|
||||
layout: 'fit',
|
||||
title: title,
|
||||
closeOnSave: true,
|
||||
width: 620,
|
||||
height: 465,
|
||||
//Add panel
|
||||
items: [
|
||||
{
|
||||
xtype: 'contactimporter.importcontactpanel',
|
||||
filename: config.filename,
|
||||
folder: config.folder
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
Zarafa.plugins.contactimporter.dialogs.ImportContentPanel.superclass.constructor.call(this, config);
|
||||
}
|
||||
Zarafa.plugins.contactimporter.dialogs.ImportContentPanel.superclass.constructor.call(this, config);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,826 +0,0 @@
|
||||
access
|
||||
|
||||
|
||||
2
|
||||
|
||||
|
||||
address_book_long
|
||||
|
||||
|
||||
0
|
||||
|
||||
|
||||
address_book_mv
|
||||
|
||||
|
||||
null
|
||||
|
||||
|
||||
address_type
|
||||
|
||||
|
||||
"SMTP"
|
||||
|
||||
|
||||
anniversary_eventid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
assistant
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
assistant_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
birthday
|
||||
|
||||
|
||||
null
|
||||
|
||||
|
||||
birthday_eventid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
body
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business2_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_address_city
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_address_country
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_address_postal_code
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_address_state
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_address_street
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_fax_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_home_page
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
business_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
callback_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
car_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
categories
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
cellular_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
company_name
|
||||
|
||||
|
||||
"testcompany"
|
||||
|
||||
|
||||
company_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
contacts
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
contacts_string
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
creation_time
|
||||
|
||||
|
||||
null
|
||||
|
||||
|
||||
department_name
|
||||
|
||||
|
||||
"departm"
|
||||
|
||||
|
||||
display_bcc
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
display_cc
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
display_name
|
||||
|
||||
|
||||
"Dr. testf testm testl Jr."
|
||||
|
||||
|
||||
display_name_prefix
|
||||
|
||||
|
||||
"Dr."
|
||||
|
||||
|
||||
display_to
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dstendday
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dstendhour
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dstendmonth
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dstendweek
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dststartday
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dststarthour
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dststartmonth
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
dststartweek
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_1
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_2
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_3
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_display_name_1
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_display_name_2
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_display_name_3
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_display_name_email_1
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_display_name_email_2
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_display_name_email_3
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_entryid_1
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_entryid_2
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_entryid_3
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_type_1
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_type_2
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_address_type_3
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
email_index
|
||||
|
||||
|
||||
-1
|
||||
|
||||
|
||||
fax_1_address_type
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_1_email_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_1_original_display_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_1_original_entryid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_2_address_type
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_2_email_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_2_original_display_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_2_original_entryid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_3_address_type
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_3_email_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_3_original_display_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fax_3_original_entryid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
fileas
|
||||
|
||||
|
||||
"testl, testf testm"
|
||||
|
||||
|
||||
fileas_selection
|
||||
|
||||
|
||||
-1
|
||||
|
||||
|
||||
generation
|
||||
|
||||
|
||||
"Jr."
|
||||
|
||||
|
||||
given_name
|
||||
|
||||
|
||||
"testf"
|
||||
|
||||
|
||||
hasattach
|
||||
|
||||
|
||||
false
|
||||
|
||||
|
||||
home2_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_address_city
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_address_country
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_address_postal_code
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_address_state
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_address_street
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_fax_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
home_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
html_body
|
||||
|
||||
|
||||
"<font face="tahoma"><br></font>"
|
||||
|
||||
|
||||
icon_index
|
||||
|
||||
|
||||
512
|
||||
|
||||
|
||||
im
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
isHTML
|
||||
|
||||
|
||||
false
|
||||
|
||||
|
||||
isdn_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
last_modification_time
|
||||
|
||||
|
||||
null
|
||||
|
||||
|
||||
mailing_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
manager_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
message_class
|
||||
|
||||
|
||||
"IPM.Contact"
|
||||
|
||||
|
||||
message_flags
|
||||
|
||||
|
||||
1
|
||||
|
||||
|
||||
message_size
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
middle_name
|
||||
|
||||
|
||||
"testm"
|
||||
|
||||
|
||||
nickname
|
||||
|
||||
|
||||
"nickn"
|
||||
|
||||
|
||||
normalized_subject
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
object_type
|
||||
|
||||
|
||||
5
|
||||
|
||||
|
||||
office_location
|
||||
|
||||
|
||||
"olocation"
|
||||
|
||||
|
||||
other_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
other_address_city
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
other_address_country
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
other_address_postal_code
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
other_address_state
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
other_address_street
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
other_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
pager_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
primary_fax_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
primary_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
private
|
||||
|
||||
|
||||
false
|
||||
|
||||
|
||||
profession
|
||||
|
||||
|
||||
"profess"
|
||||
|
||||
|
||||
radio_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
read_receipt_requested
|
||||
|
||||
|
||||
false
|
||||
|
||||
|
||||
sender_address_type
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sender_email_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sender_entryid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sender_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sender_search_key
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sensitivity
|
||||
|
||||
|
||||
0
|
||||
|
||||
|
||||
sent_representing_address_type
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sent_representing_email_address
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sent_representing_entryid
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sent_representing_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
sent_representing_search_key
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
spouse_name
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
subject
|
||||
|
||||
|
||||
"testf testm testl"
|
||||
|
||||
|
||||
surname
|
||||
|
||||
|
||||
"testl"
|
||||
|
||||
|
||||
telex_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
timezone
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
timezonedst
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
title
|
||||
|
||||
|
||||
"jobt"
|
||||
|
||||
|
||||
ttytdd_telephone_number
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
unk
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
webpage
|
||||
|
||||
|
||||
""
|
||||
|
||||
|
||||
wedding_anniversary
|
||||
|
||||
|
||||
null
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* plugin.contactimporter.js zarafa contactimporter
|
||||
* plugin.contactimporter.js, Kopano Webapp contact to vcf im/exporter
|
||||
*
|
||||
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
||||
* Copyright (C) 2012-2016 Christoph Haas
|
||||
@@ -24,274 +24,275 @@ Ext.namespace("Zarafa.plugins.contactimporter"); // Assign the right nam
|
||||
|
||||
Zarafa.plugins.contactimporter.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.contactimporter.ImportPlugin.superclass.constructor.call(this, config);
|
||||
},
|
||||
Zarafa.plugins.contactimporter.ImportPlugin.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* initialises insertion point for plugin
|
||||
* @protected
|
||||
*/
|
||||
initPlugin: function () {
|
||||
Zarafa.plugins.contactimporter.ImportPlugin.superclass.initPlugin.apply(this, arguments);
|
||||
/**
|
||||
* initialises insertion point for plugin
|
||||
* @protected
|
||||
*/
|
||||
initPlugin: function () {
|
||||
Zarafa.plugins.contactimporter.ImportPlugin.superclass.initPlugin.apply(this, arguments);
|
||||
|
||||
/* our panel */
|
||||
Zarafa.core.data.SharedComponentType.addProperty('plugins.contactimporter.dialogs.importcontacts');
|
||||
/* our panel */
|
||||
Zarafa.core.data.SharedComponentType.addProperty('plugins.contactimporter.dialogs.importcontacts');
|
||||
|
||||
/* directly import received vcfs */
|
||||
this.registerInsertionPoint('common.contextmenu.attachment.actions', this.createAttachmentImportButton, this);
|
||||
/* directly import received vcfs */
|
||||
this.registerInsertionPoint('common.contextmenu.attachment.actions', this.createAttachmentImportButton, this);
|
||||
|
||||
/* export a contact via rightclick */
|
||||
this.registerInsertionPoint('context.contact.contextmenu.actions', this.createItemExportInsertionPoint, this);
|
||||
},
|
||||
/* export a contact via rightclick */
|
||||
this.registerInsertionPoint('context.contact.contextmenu.actions', this.createItemExportInsertionPoint, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* 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 vCard'),
|
||||
handler: this.exportToVCF.createDelegate(this, [btn]),
|
||||
scope : this,
|
||||
iconCls: 'icon_contactimporter_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_contactimporter', 'Export vCard'),
|
||||
handler: this.exportToVCF.createDelegate(this, [btn]),
|
||||
scope: this,
|
||||
iconCls: 'icon_contactimporter_export'
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates a request to download the selected records as vCard.
|
||||
* @param {Ext.Button} btn
|
||||
*/
|
||||
exportToVCF: 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
|
||||
*/
|
||||
exportToVCF: 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.contactimporter.data.ResponseHandler({
|
||||
successCallback: this.downloadVCF,
|
||||
scope : this
|
||||
});
|
||||
var responseHandler = new Zarafa.plugins.contactimporter.data.ResponseHandler({
|
||||
successCallback: this.downloadVCF,
|
||||
scope: this
|
||||
});
|
||||
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'contactmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: btn.records[0].get("store_entryid"),
|
||||
records: recordIds
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'contactmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: btn.records[0].get("store_entryid"),
|
||||
records: recordIds
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Callback for the export request.
|
||||
* @param {Object} response
|
||||
*/
|
||||
downloadVCF: 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
|
||||
*/
|
||||
downloadVCF: function (response) {
|
||||
if (response.status == false) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_contactimporter', '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_vcf";
|
||||
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_vcf";
|
||||
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;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert import button in all attachment suggestions
|
||||
/**
|
||||
* Insert import button in all attachment suggestions
|
||||
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*/
|
||||
createAttachmentImportButton: function (include, btn) {
|
||||
return {
|
||||
text : _('Import to Contacts'),
|
||||
handler : this.getAttachmentFileName.createDelegate(this, [btn]),
|
||||
scope : this,
|
||||
iconCls : 'icon_contactimporter_button',
|
||||
beforeShow: function (item, record) {
|
||||
var extension = record.data.name.split('.').pop().toLowerCase();
|
||||
* @return {Object} Configuration object for a {@link Ext.Button button}
|
||||
*/
|
||||
createAttachmentImportButton: function (include, btn) {
|
||||
return {
|
||||
text: dgettext('plugin_contactimporter', 'Import to Contacts'),
|
||||
handler: this.getAttachmentFileName.createDelegate(this, [btn]),
|
||||
scope: this,
|
||||
iconCls: 'icon_contactimporter_button',
|
||||
beforeShow: function (item, record) {
|
||||
var extension = record.data.name.split('.').pop().toLowerCase();
|
||||
|
||||
if (record.data.filetype == "text/vcard" || record.data.filetype == "text/x-vcard" || extension == "vcf" || extension == "vcard") {
|
||||
item.setVisible(true);
|
||||
} else {
|
||||
item.setVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
if (record.data.filetype == "text/vcard" || record.data.filetype == "text/x-vcard" || extension == "vcf" || extension == "vcard") {
|
||||
item.setVisible(true);
|
||||
} else {
|
||||
item.setVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Callback for getAttachmentFileName
|
||||
* @param {Object} response
|
||||
*/
|
||||
gotAttachmentFileName: function (response) {
|
||||
if (response.status == true) {
|
||||
this.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
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Callback for getAttachmentFileName
|
||||
* @param {Object} response
|
||||
*/
|
||||
gotAttachmentFileName: function (response) {
|
||||
if (response.status == true) {
|
||||
this.openImportDialog(response.tmpname);
|
||||
} else {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_contactimporter', 'Error'),
|
||||
msg: _(response["message"]),
|
||||
icon: Zarafa.common.dialogs.MessageBox.ERROR,
|
||||
buttons: Zarafa.common.dialogs.MessageBox.OK
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Clickhandler for the button
|
||||
* @param {Ext.Button} btn
|
||||
*/
|
||||
getAttachmentFileName: function (btn) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title : 'Please wait',
|
||||
msg : 'Loading attachment...',
|
||||
progressText: 'Initializing...',
|
||||
width : 300,
|
||||
progress : true,
|
||||
closable : false
|
||||
});
|
||||
/**
|
||||
* Clickhandler for the button
|
||||
* @param {Ext.Button} btn
|
||||
*/
|
||||
getAttachmentFileName: function (btn) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_contactimporter', 'Please wait'),
|
||||
msg: dgettext('plugin_contactimporter', 'Loading attachment...'),
|
||||
progressText: dgettext('plugin_contactimporter', 'Initializing...'),
|
||||
width: 300,
|
||||
progress: true,
|
||||
closable: 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');
|
||||
}
|
||||
};
|
||||
};
|
||||
// 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_contactimporter', '{0}% loaded'), Math.round(v)));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
for (var i = 1; i < 101; i++) {
|
||||
setTimeout(f(i), 20 * i);
|
||||
}
|
||||
for (var i = 1; i < 101; i++) {
|
||||
setTimeout(f(i), 20 * i);
|
||||
}
|
||||
|
||||
/* store the attachment to a temporary folder and prepare it for uploading */
|
||||
var attachmentRecord = btn.records;
|
||||
var attachmentStore = attachmentRecord.store;
|
||||
/* store the attachment to a temporary folder and prepare it for uploading */
|
||||
var attachmentRecord = btn.records;
|
||||
var attachmentStore = attachmentRecord.store;
|
||||
|
||||
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;
|
||||
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;
|
||||
|
||||
var responseHandler = new Zarafa.plugins.contactimporter.data.ResponseHandler({
|
||||
successCallback: this.gotAttachmentFileName.createDelegate(this),
|
||||
scope : this
|
||||
});
|
||||
var responseHandler = new Zarafa.plugins.contactimporter.data.ResponseHandler({
|
||||
successCallback: this.gotAttachmentFileName.createDelegate(this),
|
||||
scope: this
|
||||
});
|
||||
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'contactmodule',
|
||||
'importattachment',
|
||||
{
|
||||
entryid : entryid,
|
||||
store : store,
|
||||
attachNum : attachNum,
|
||||
dialog_attachments: dialog_attachments,
|
||||
filename : filename
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'contactmodule',
|
||||
'importattachment',
|
||||
{
|
||||
entryid: entryid,
|
||||
store: store,
|
||||
attachNum: attachNum,
|
||||
dialog_attachments: dialog_attachments,
|
||||
filename: filename
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Open the import dialog.
|
||||
* @param {String} filename
|
||||
*/
|
||||
openImportDialog: function (filename) {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.contactimporter.dialogs.importcontacts'];
|
||||
var config = {
|
||||
filename: filename,
|
||||
modal : true
|
||||
};
|
||||
/**
|
||||
* Open the import dialog.
|
||||
* @param {String} filename
|
||||
*/
|
||||
openImportDialog: function (filename) {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.contactimporter.dialogs.importcontacts'];
|
||||
var config = {
|
||||
filename: filename,
|
||||
modal: true
|
||||
};
|
||||
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
},
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* Bid for the type of shared component
|
||||
* and the given record.
|
||||
* This will bid on calendar.dialogs.importcontacts
|
||||
* @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.contactimporter.dialogs.importcontacts']:
|
||||
bid = 1;
|
||||
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.Contact") {
|
||||
bid = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return bid;
|
||||
},
|
||||
/**
|
||||
* Bid for the type of shared component
|
||||
* and the given record.
|
||||
* This will bid on calendar.dialogs.importcontacts
|
||||
* @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.contactimporter.dialogs.importcontacts']:
|
||||
bid = 1;
|
||||
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.Contact") {
|
||||
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.contactimporter.dialogs.importcontacts']:
|
||||
component = Zarafa.plugins.contactimporter.dialogs.ImportContentPanel;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['common.contextmenu']:
|
||||
component = Zarafa.plugins.contactimporter.ui.ContextMenu;
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* 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.contactimporter.dialogs.importcontacts']:
|
||||
component = Zarafa.plugins.contactimporter.dialogs.ImportContentPanel;
|
||||
break;
|
||||
case Zarafa.core.data.SharedComponentType['common.contextmenu']:
|
||||
component = Zarafa.plugins.contactimporter.ui.ContextMenu;
|
||||
break;
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
return component;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -299,10 +300,10 @@ Zarafa.plugins.contactimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
|
||||
* STARTUP
|
||||
*############################################################################################################################*/
|
||||
Zarafa.onReady(function () {
|
||||
container.registerPlugin(new Zarafa.core.PluginMetaData({
|
||||
name : 'contactimporter',
|
||||
displayName : _('Contactimporter Plugin'),
|
||||
about : Zarafa.plugins.contactimporter.ABOUT,
|
||||
pluginConstructor: Zarafa.plugins.contactimporter.ImportPlugin
|
||||
}));
|
||||
container.registerPlugin(new Zarafa.core.PluginMetaData({
|
||||
name: 'contactimporter',
|
||||
displayName: dgettext('plugin_contactimporter', 'Contactimporter Plugin'),
|
||||
about: Zarafa.plugins.contactimporter.ABOUT,
|
||||
pluginConstructor: Zarafa.plugins.contactimporter.ImportPlugin
|
||||
}));
|
||||
});
|
||||
|
@@ -1,3 +1,25 @@
|
||||
/**
|
||||
* ContextMenu.js, Kopano Webapp contact to vcf 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.contactimporter.ui');
|
||||
|
||||
/**
|
||||
@@ -7,130 +29,130 @@ Ext.namespace('Zarafa.plugins.contactimporter.ui');
|
||||
*/
|
||||
Zarafa.plugins.contactimporter.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.contactimporter.ui.ContextMenu.superclass.constructor.call(this, config);
|
||||
Zarafa.plugins.contactimporter.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.contactimporter.ui.ContextMenu.superclass.constructor.call(this, config); // redo ... otherwise menu does not get published
|
||||
},
|
||||
Zarafa.plugins.contactimporter.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.contactimporter.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.contactimporter.ui.ContextMenu HierarchyContextMenu}
|
||||
*/
|
||||
createAdditionalContextMenuItems: function (config) {
|
||||
return [{
|
||||
xtype: 'menuseparator'
|
||||
}, {
|
||||
text : _('Import vCard'),
|
||||
iconCls : 'icon_contactimporter_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 vCard'),
|
||||
iconCls : 'icon_contactimporter_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.contactimporter.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.contactimporter.ui.ContextMenu HierarchyContextMenu}
|
||||
*/
|
||||
createAdditionalContextMenuItems: function (config) {
|
||||
return [{
|
||||
xtype: 'menuseparator'
|
||||
}, {
|
||||
text: dgettext('plugin_contactimporter', 'Import vCard'),
|
||||
iconCls: 'icon_contactimporter_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_contactimporter', 'Export vCard'),
|
||||
iconCls: 'icon_contactimporter_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.contactimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemExport: function () {
|
||||
var responseHandler = new Zarafa.plugins.contactimporter.data.ResponseHandler({
|
||||
successCallback: this.downloadVCF,
|
||||
scope : this
|
||||
});
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.contactimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemExport: function () {
|
||||
var responseHandler = new Zarafa.plugins.contactimporter.data.ResponseHandler({
|
||||
successCallback: this.downloadVCF,
|
||||
scope: this
|
||||
});
|
||||
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'contactmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: this.records.get("store_entryid"),
|
||||
folder : this.records.get("entryid")
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
// request attachment preperation
|
||||
container.getRequest().singleRequest(
|
||||
'contactmodule',
|
||||
'export',
|
||||
{
|
||||
storeid: this.records.get("store_entryid"),
|
||||
folder: this.records.get("entryid")
|
||||
},
|
||||
responseHandler
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.contactimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemImport: function () {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.contactimporter.dialogs.importcontacts'];
|
||||
var config = {
|
||||
modal : true,
|
||||
folder: this.records.get("entryid")
|
||||
};
|
||||
/**
|
||||
* Fires on selecting 'Open' menu option from {@link Zarafa.plugins.contactimporter.ui.ContextMenu ContextMenu}
|
||||
* @private
|
||||
*/
|
||||
onContextItemImport: function () {
|
||||
var componentType = Zarafa.core.data.SharedComponentType['plugins.contactimporter.dialogs.importcontacts'];
|
||||
var config = {
|
||||
modal: true,
|
||||
folder: this.records.get("entryid")
|
||||
};
|
||||
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
},
|
||||
Zarafa.core.data.UIFactory.openLayerComponent(componentType, undefined, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* Callback for the export request.
|
||||
* @param {Object} response
|
||||
*/
|
||||
downloadVCF: 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
|
||||
*/
|
||||
downloadVCF: function (response) {
|
||||
if (response.status == false) {
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title: dgettext('plugin_contactimporter', '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_vcf";
|
||||
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_vcf";
|
||||
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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Ext.reg('contactimporter.hierarchycontextmenu', Zarafa.plugins.contactimporter.ui.ContextMenu);
|
||||
|
Reference in New Issue
Block a user