[Vtigercrm-commits] [vtiger-commits] r10915 - in /vtigercrm/branches/5.0.3: Smarty/templates/DetailView.tpl Smarty/templates/RelatedListContents.tpl include/js/Mail.js modules/Emails/mailSelect.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon May 14 10:55:26 EDT 2007
Author: richie
Date: Mon May 14 08:55:13 2007
New Revision: 10915
Log:
fix for account module - listview -email pop up. Fixes #3692 --minnie
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl
vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl
vtigercrm/branches/5.0.3/include/js/Mail.js
vtigercrm/branches/5.0.3/modules/Emails/mailSelect.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 14 08:55:13 2007
@@ -178,7 +178,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(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(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}">
{/if}
{/if}
{if $MODULE eq 'Quotes' || $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}
Modified: vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl Mon May 14 08:55:13 2007
@@ -131,7 +131,7 @@
{if $MAIL_CHECK eq 'true'}
<input title="{$APP.LBL_ADD_NEW} {$APP.Email}" accessyKey="F" class="crmbutton small create" onclick="fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID});" type="button" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Email}"></td>
{else}
- <input title="{$APP.LBL_ADD_NEW} {$APP.Email}" accessyKey="F" class="crmbutton small create" onclick="javascript:alert('{$APP.LBL_THIS}{$APP.$MODULE}{$APP.DOESNOT_HAVE_MAILIDS}');" type="button" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Email}"></td>
+ <input title="{$APP.LBL_ADD_NEW} {$APP.Email}" accessyKey="F" class="crmbutton small create" onclick="OpenCompose('','create');" type="button" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Email}"></td>
{/if}
{else}
<input title="{$APP.LBL_ADD_NEW} {$APP.Email}" accessyKey="F" class="crmbutton small create" onclick="fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID});" type="button" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Email}"></td>
Modified: vtigercrm/branches/5.0.3/include/js/Mail.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/Mail.js (original)
+++ vtigercrm/branches/5.0.3/include/js/Mail.js Mon May 14 08:55:13 2007
@@ -122,7 +122,7 @@
method: 'post',
postBody: "module=Emails&return_module="+module+"&action=EmailsAjax&file=mailSelect&idlist="+idstrings,
onComplete: function(response) {
- if(response.responseText == "Mail Ids not permitted")
+ if(response.responseText == "Mail Ids not permitted" || response.responseText == "No Mail Ids")
{
var url= 'index.php?module=Emails&action=EmailsAjax&pmodule='+module+'&file=EditView&sendmail=true';
openPopUp('xComposeEmail',this,url,'createemailWin',820,689,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
Modified: vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php Mon May 14 08:55:13 2007
@@ -26,7 +26,7 @@
$userid = $current_user->id;
-$querystr = "select fieldid, fieldlabel, columnname from vtiger_field where tabid=".getTabid($pmodule)." and uitype=13";
+$querystr = "select fieldid, fieldname, fieldlabel, columnname from vtiger_field where tabid=".getTabid($pmodule)." and uitype=13";
$res=$adb->query($querystr);
$numrows = $adb->num_rows($res);
@@ -49,7 +49,8 @@
if($single_record && count($columnlists) > 0)
{
- $count = 0;
+ $count = 0;
+ $val_cnt = 0;
switch($pmodule)
{
case 'Accounts':
@@ -57,7 +58,10 @@
$result=$adb->query($query);
foreach($columnlists as $columnname)
{
- $field_value[$count++] = $adb->query_result($result,0,$columnname);
+ $acc_eval = $adb->query_result($result,0,$columnname);
+ $field_value[$count++] = $acc_eval;
+ if($acc_eval != "") $val_cnt++;
+
}
$entity_name = $adb->query_result($result,0,'accountname');
break;
@@ -66,7 +70,9 @@
$result=$adb->query($query);
foreach($columnlists as $columnname)
{
- $field_value[$count++] = $adb->query_result($result,0,$columnname);
+ $lead_eval = $adb->query_result($result,0,$columnname);
+ $field_value[$count++] = $lead_eval;
+ if($lead_eval != "") $val_cnt++;
}
$entity_name = $adb->query_result($result,0,'leadname');
break;
@@ -75,7 +81,9 @@
$result=$adb->query($query);
foreach($columnlists as $columnname)
{
- $field_value[$count++] = $adb->query_result($result,0,$columnname);
+ $con_eval = $adb->query_result($result,0,$columnname);
+ $field_value[$count++] = $con_eval;
+ if($con_eval != "") $val_cnt++;
}
$entity_name = $adb->query_result($result,0,'contactname');
break;
@@ -91,9 +99,12 @@
$smarty->assign("APP", $app_strings);
$smarty->assign("FROM_MODULE", $pmodule);
$smarty->assign("IMAGE_PATH",$image_path);
-
-if(count($columnlists) > 0)
+if($single_record && count($columnlists) > 0 && $val_cnt > 0)
$smarty->display("SelectEmail.tpl");
+else if(!$single_record && count($columnlists) > 0)
+ $smarty->display("SelectEmail.tpl");
+else if($single_record && $val_cnt == 0)
+ echo "No Mail Ids";
else
echo "Mail Ids not permitted";
?>
More information about the vtigercrm-commits
mailing list