[Vtigercrm-commits] [vtiger-commits] r10221 - in /vtigercrm/branches/5.0.3: Smarty/templates/DetailView.tpl Smarty/templates/SelectEmail.tpl include/js/dtlviewajax.js modules/Contacts/DetailView.php modules/Leads/DetailView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Feb 21 05:38:30 EST 2007
Author: saraj
Date: Wed Feb 21 03:38:16 2007
New Revision: 10221
Log:
fix for sendmail while email changed through ajax edit --Minnie
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl
vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl
vtigercrm/branches/5.0.3/include/js/dtlviewajax.js
vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php
vtigercrm/branches/5.0.3/modules/Leads/DetailView.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 Wed Feb 21 03:38:16 2007
@@ -174,16 +174,13 @@
<input title="Reply to Sender" class="crmbutton small create" onclick="window.location='index.php?module={$MODULE}&action=EditView&mailid={$ID}&reply=single&return_action=DetailView&return_module=Webmails&return_id={$ID}';return false;" type="submit" name="replytosender" value="Reply to Sender">
<input title="Reply to All" class="crmbutton small create" onclick="window.location='index.php?module={$MODULE}&action=EditView&mailid={$ID}&reply=all&return_action=DetailView&return_module=Webmails&return_id={$ID}';return false;" type="submit" name="replytosender" value="Reply to All">
{/if}
- {if $MODULE eq 'Leads' || $MODULE eq 'Contacts'}
- {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}','{$EMAIL}','{$YAHOO}')){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 '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}','{$EMAIL1}','{$EMAIL2}')){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 'Leads' || $MODULE eq 'Contacts' || $MODULE eq 'Accounts'}
+ {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(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}">
+ {/if}
+ {/if}
{if $MODULE eq 'Quotes' || $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
{if $CREATEPDF eq 'permitted'}
<input title="Export To PDF" accessKey="Alt+e" class="crmbutton small create" onclick="this.form.return_module.value='{$MODULE}'; this.form.return_action.value='DetailView'; this.form.return_id.value='{$ID}'; this.form.module.value='{$MODULE}'; {if $MODULE eq 'SalesOrder'} this.form.action.value='CreateSOPDF'" {else} this.form.action.value='CreatePDF'" {/if} type="submit" name="Export To PDF" value="{$APP.LBL_EXPORT_TO_PDF}">
@@ -332,16 +329,11 @@
<input title="Reply to Sender" class="crmbutton small create" onclick="window.location='index.php?module={$MODULE}&action=EditView&mailid={$ID}&reply=single&return_action=DetailView&return_module=Webmails&return_id={$ID}';return false;" type="submit" name="replytosender" value="Reply to Sender">
<input title="Reply to All" class="crmbutton small create" onclick="window.location='index.php?module={$MODULE}&action=EditView&mailid={$ID}&reply=all&return_action=DetailView&return_module=Webmails&return_id={$ID}';return false;" type="submit" name="replytosender" value="Reply to All">
{/if}
- {if $MODULE eq 'Leads' || $MODULE eq 'Contacts'}
- {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}','{$EMAIL}','{$YAHOO}')){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 '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}','{$EMAIL1}','{$EMAIL2}')){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 '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}">
+ {/if}
+ {/if}
{if $MODULE eq 'Quotes' || $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
{if $CREATEPDF eq 'permitted'}
<input title="Export To PDF" accessKey="Alt+e" class="crmbutton small create" onclick="this.form.return_module.value='{$MODULE}'; this.form.return_action.value='DetailView'; this.form.return_id.value='{$ID}'; this.form.module.value='{$MODULE}'; {if $MODULE eq 'SalesOrder'} this.form.action.value='CreateSOPDF'" {else} this.form.action.value='CreatePDF'" {/if} type="submit" name="Export To PDF" value="{$APP.LBL_EXPORT_TO_PDF}">
Modified: vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl Wed Feb 21 03:38:16 2007
@@ -33,14 +33,14 @@
{else}
{$MOD.LBL_MAILSELECT_INFO1} {$APP[$FROM_MODULE]}.{$MOD.LBL_MAILSELECT_INFO2}<br><br>
{/if}
- <div style="height:120px;overflow-y:auto;averflow-x:hidden;" align="center">
+ <div style="height:120px;overflow-y:auto;overflow-x:hidden;" align="center">
<table border="0" cellpadding="5" cellspacing="0" width="90%">
{foreach name=emailids key=fieldid item=elements from=$MAILINFO}
<tr>
{if $smarty.foreach.emailids.iteration eq 1}
- <td align="center"><input type="checkbox" value="{$fieldid}" name="email" /></td>
+ <td align="center"><input type="checkbox" value="{$fieldid}" name="semail" /></td>
{else}
- <td align="center"><input type="checkbox" value="{$fieldid}" name="email" /></td>
+ <td align="center"><input type="checkbox" value="{$fieldid}" name="semail" /></td>
{/if}
{if $ONE_RECORD eq 'true'}
<td align="left"><b>{$elements.0} </b><br>{$MAILDATA[$smarty.foreach.emailids.iteration]}</td>
Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/dtlviewajax.js (original)
+++ vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Wed Feb 21 03:38:16 2007
@@ -213,6 +213,15 @@
if(uitype == '13' || uitype == '104')
{
getObj(dtlView).innerHTML = "<a href=\"mailto:"+ tagValue+"\" target=\"_blank\">"+tagValue+" </a>";
+ if(fieldName == "email" || fieldName == "email1"){
+ var priEmail = getObj("pri_email");
+ if(priEmail)
+ priEmail.value = tagValue;
+ }else{
+ var secEmail = getObj("sec_email");
+ if(secEmail)
+ secEmail.value = tagValue;
+ }
}else if(uitype == '17')
{
getObj(dtlView).innerHTML = "<a href=\"http://"+ tagValue+"\" target=\"_blank\">"+tagValue+" </a>";
Modified: vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Wed Feb 21 03:38:16 2007
@@ -85,6 +85,9 @@
$parent_email = getEmailParentsList('Contacts',$_REQUEST['record']);
$smarty->assign("HIDDEN_PARENTS_LIST",$parent_email);
$smarty->assign("SENDMAILBUTTON","permitted");
+ $smarty->assign("EMAIL1",$focus->column_fields['email']);
+ $smarty->assign("EMAIL2",$focus->column_fields['yahooid']);
+
}
if(isPermitted("Contacts","Merge",'') == 'yes')
@@ -119,9 +122,6 @@
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
-$smarty->assign("EMAIL",$focus->column_fields['email']);
-$smarty->assign("YAHOO",$focus->column_fields['yahooid']);
-
$smarty->assign("MODULE",$currentModule);
$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record]));
$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule));
Modified: vtigercrm/branches/5.0.3/modules/Leads/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Leads/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Wed Feb 21 03:38:16 2007
@@ -93,6 +93,9 @@
$parent_email = getEmailParentsList('Leads',$_REQUEST['record']);
$smarty->assign("HIDDEN_PARENTS_LIST",$parent_email);
$smarty->assign("SENDMAILBUTTON","permitted");
+ $smarty->assign("EMAIL1",$focus->column_fields['email']);
+ $smarty->assign("EMAIL2",$focus->column_fields['yahooid']);
+
}
if(isPermitted("Leads","Merge",'') == 'yes')
@@ -119,9 +122,6 @@
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
-$smarty->assign("EMAIL",$focus->column_fields['email']);
-$smarty->assign("YAHOO",$focus->column_fields['yahooid']);
-
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
More information about the vtigercrm-commits
mailing list