[Vtigercrm-commits] [vtiger-commits] r11090 - in /vtigercrm/branches/5.0.3: Smarty/templates/DetailView.tpl include/js/general.js modules/Emails/Emails.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon May 28 10:34:03 EDT 2007
Author: richie
Date: Mon May 28 08:33:56 2007
New Revision: 11090
Log:
fix for send mail option in leads/contacts/accounts. --minnie
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl
vtigercrm/branches/5.0.3/include/js/general.js
vtigercrm/branches/5.0.3/modules/Emails/Emails.php
Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Mon May 28 08:33:56 2007
@@ -19,7 +19,6 @@
<span id="crmspanid" style="display:none;position:absolute;" onmouseover="show('crmspanid');">
<a class="link" align="right" href="javascript:;">{$APP.LBL_EDIT_BUTTON}</a>
</span>
-
<div id="convertleaddiv" style="display:block;position:absolute;left:225px;top:150px;"></div>
<script>
@@ -175,7 +174,7 @@
{if $SENDMAILBUTTON eq 'permitted'}
<input type="hidden" name="pri_email" value="{$EMAIL1}"/>
<input type="hidden" name="sec_email" value="{$EMAIL2}"/>
- <input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="crmbutton small edit" onclick="if(document.DetailView.pri_email.value !='' || document.DetailView.sec_email.value !=''){ldelim}fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID}){rdelim}else{ldelim}OpenCompose('','create'){rdelim}" type="button" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">
+ <input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="crmbutton small edit" onclick="if(LTrim(document.DetailView.pri_email.value) !='' || LTrim(document.DetailView.sec_email.value) !=''){ldelim}fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID}){rdelim}else{ldelim}OpenCompose('','create'){rdelim}" type="button" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">
{/if}
{/if}
{if $MODULE eq 'Quotes' || $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
@@ -328,7 +327,7 @@
{/if}
{if $MODULE eq 'Leads' || $MODULE eq 'Contacts' || $MODULE eq 'Accounts'}
{if $SENDMAILBUTTON eq 'permitted'}
- <input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="crmbutton small edit" onclick="if(checkEmailid('{$MODULE}',document.DetailView.pri_email.value,document.DetailView.sec_email.value)){ldelim}fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID}){rdelim}else{ldelim}return false{rdelim}" type="button" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">
+ <input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="crmbutton small edit" onclick="if(checkEmailid('{$MODULE}',LTrim(document.DetailView.pri_email.value),document.DetailView.sec_email.value)){ldelim}fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID}){rdelim}else{ldelim}return false{rdelim}" type="button" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">
{/if}
{/if}
{if $MODULE eq 'Quotes' || $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
@@ -466,6 +465,7 @@
{/if}
<script>
+
function getTagCloud()
{ldelim}
new Ajax.Request(
@@ -495,4 +495,3 @@
{if $MODULE eq 'Leads' or $MODULE eq 'Contacts' or $MODULE eq 'Accounts'}
<form name="SendMail"><div id="sendmail_cont" style="z-index:100001;position:absolute;"></div></form>
{/if}
-
Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Mon May 28 08:33:56 2007
@@ -2166,3 +2166,10 @@
}
}
+function LTrim( value )
+{
+
+ var re = /\s*((\S+\s*)*)/;
+ return value.replace(re, "$1");
+
+}
Modified: vtigercrm/branches/5.0.3/modules/Emails/Emails.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/Emails.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/Emails.php Mon May 28 08:33:56 2007
@@ -458,15 +458,15 @@
switch($module)
{
case 'Leads':
- $query = 'select crmid,concat(lastname," ",firstname) as entityname,'.$columnlists.' from vtiger_leaddetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid left join vtiger_leadscf on vtiger_leadscf.leadid = vtiger_leaddetails.leadid where vtiger_crmentity.deleted=0 and vtiger_crmentity.crmid in ('.$crmids.')';
+ $query = 'select crmid,concat(lastname," ",firstname) as entityname,'.$columnlists.' from vtiger_leaddetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid left join vtiger_leadscf on vtiger_leadscf.leadid = vtiger_leaddetails.leadid where vtiger_crmentity.deleted=0 and ((ltrim(vtiger_leaddetails.email) != \'\') or (ltrim(vtiger_leaddetails.yahooid) != \'\')) and vtiger_crmentity.crmid in ('.$crmids.')';
break;
case 'Contacts':
- $query = 'select crmid,concat(lastname," ",firstname) as entityname,'.$columnlists.' from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid left join vtiger_contactscf on vtiger_contactscf.contactid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted=0 and vtiger_crmentity.crmid in ('.$crmids.')';
+ $query = 'select crmid,concat(lastname," ",firstname) as entityname,'.$columnlists.' from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid left join vtiger_contactscf on vtiger_contactscf.contactid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted=0 and ((ltrim(vtiger_contactdetails.email) != \'\') or (ltrim(vtiger_contactdetails.yahooid) != \'\')) and vtiger_crmentity.crmid in ('.$crmids.')';
break;
case 'Accounts':
- $query = 'select crmid,accountname as entityname,'.$columnlists.' from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid left join vtiger_accountscf on vtiger_accountscf.accountid = vtiger_account.accountid where vtiger_crmentity.deleted=0 and vtiger_crmentity.crmid in ('.$crmids.')';
+ $query = 'select crmid,accountname as entityname,'.$columnlists.' from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid left join vtiger_accountscf on vtiger_accountscf.accountid = vtiger_account.accountid where vtiger_crmentity.deleted=0 and ((ltrim(vtiger_account.email1) != \'\') or (ltrim(vtiger_account.email2) != \'\')) and vtiger_crmentity.crmid in ('.$crmids.')';
break;
- }
+ }
$result = $adb->query($query);
while($row = $adb->fetch_array($result))
{
More information about the vtigercrm-commits
mailing list