[Vtigercrm-developers] Thunderbird Plugin question

Sukruth Mk sukruth.mk at vtiger.com
Tue Aug 4 09:39:31 GMT 2015


Hi Alan,

We have identified and fixed couple of issues in thunderbird

1. While trying to edit and attach message to vtiger it was showing blank
page in Thunderbird.
2. Thunderbird was showing warning message  if we try to attach email and
also it was failing to attach email if date is greater than 12 and my
preference date format is mm-dd-yyyy in vtiger.

please review the diff patch.



*Thanks & Regards*
* Sukruth M K*


*Connect with us on: *Twitter <http://twitter.com/vtigercrm> *I* Facebook
<http://www.facebook.com/pages/vtiger/226866697333578?sk=wall> *I* Blog
<https://blogs.vtiger.com/>* I* Wiki
<http://wiki.vtiger.com/index.php/Main_Page> *I *Forums
<https://discussions.vtiger.com>*I* Website <https://www.vtiger.com/>

On Tue, Aug 4, 2015 at 2:16 PM, Vikas Jain <vikas at vtiger.com> wrote:

>
> ---------- Forwarded message ----------
> From: Alan Lord (News) <alanslists at gmail.com>
> Date: 4 August 2015 at 00:10
> Subject: Re: [Vtigercrm-developers] Thunderbird Plugin question
> To: vtigercrm-developers at lists.vtigercrm.com
>
>
> On 03/08/15 16:40, Simone Travaglini wrote:
>
>> Hi to all,
>> I noticed that when trying to attach email to contact now content of
>> mail is not saved. Some time ago it was working. Is it possible the
>> problem is related with last version of thunderbird? Other people faced
>> same problem?
>>
>
> It's working for me.
>
> I'm using TB 31.8.0 on Ubuntu 15.04 and our vtiger system is 6.3.0 on
> Ubuntu Server 14.04.
>
> Cheers
>
> Al
>
> --
> Libertus Solutions
> http://www.libertus.co.uk
>
> _______________________________________________
> http://www.vtiger.com/
>
>
>
> --
> Regards
> Vikas
> Vtiger Team
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150804/82d0216f/attachment.html>
-------------- next part --------------
Index: vtiger/plugins/thunderbird/branches/sukruth/chrome/content/addtovtiger.js
===================================================================
--- vtiger/plugins/thunderbird/branches/sukruth/chrome/content/addtovtiger.js	(revision 71072)
+++ vtiger/plugins/thunderbird/branches/sukruth/chrome/content/addtovtiger.js	(revision 71078)
@@ -38,5 +38,5 @@
 	// Set the charset of the iFrame content. Thanks to Jonathan Protzenko for the cluebat.
 	let cv = iframe.docShell.contentViewer;
-    cv.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
+	try { cv.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);} catch (e) {/*not supported in newer version*/}
     cv.hintCharacterSet = "UTF-8";
     cv.hintCharacterSetSource = 11;
@@ -256,23 +256,11 @@
 			var fields = res['fields'];
 			var format = 'yyyy-mm-dd';
-			for(var i=0;i<fields.length;++i){
-				if(fields[i]['name'] == 'date_start'){
-					format = fields[i]['type']['format'];
-				}
-			}
-			function getFormatedDate(format,date){
+			function getFormatedDate(date){
 				var displayDate;
-				var list = format.split('-');
 				var dd = (date.getDate().toString().length ==1)? '0'+date.getDate(): date.getDate();
 				//The value returned by getMonth() is a number between 0 and 11
-				var mm = (date.getMonth().toString().length ==1)? '0'+(date.getMonth()+1): date.getMonth()+1;
-				var yy = date.getFullYear();
-				if(format == 'dd-mm-yyyy'){
-					displayDate = dd+'-'+mm+'-'+yy;
-				}else if(format == 'mm-dd-yyyy'){
-					displayDate = mm+'-'+dd+'-'+yy;
-				}else if(format == 'yyyy-mm-dd'){		
-					displayDate = yy+'-'+mm+'-'+dd;
-				}
+				var mm = ((date.getMonth()+1).toString().length ==1)? '0'+(date.getMonth()+1): date.getMonth()+1;
+				var yy = date.getFullYear();		
+				displayDate = yy+'-'+mm+'-'+dd;
 				return displayDate;
 			}
@@ -286,5 +274,5 @@
 				email["ccmail"] = window.arguments[0].cc;
 			}
-			email["date_start"] = getFormatedDate(format,date);
+			email["date_start"] = getFormatedDate(date);
 			email["saved_toid"] = document.getElementById('lstcontactinfo').selectedItem.childNodes[emailNodeIndex].getAttribute('label');
 			email["subject"] = email_subject;


More information about the vtigercrm-developers mailing list