[Vtigercrm-commits] [vtiger-commits] r7691 - in /vtigercrm/trunk: Smarty/templates/EmailDetails.tpl include/js/general.js include/utils/ListViewUtils.php modules/Emails/DetailView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Jun 30 03:14:07 EDT 2006


Author: richie
Date: Fri Jun 30 01:14:00 2006
New Revision: 7691

Log:
Email Detailview from Related lists has been integrated

Modified:
    vtigercrm/trunk/Smarty/templates/EmailDetails.tpl
    vtigercrm/trunk/include/js/general.js
    vtigercrm/trunk/include/utils/ListViewUtils.php
    vtigercrm/trunk/modules/Emails/DetailView.php

Modified: vtigercrm/trunk/Smarty/templates/EmailDetails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/EmailDetails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/EmailDetails.tpl Fri Jun 30 01:14:00 2006
@@ -24,7 +24,7 @@
 				{/if}
 				{foreach item=row from=$BLOCKS}	
 				{foreach item=elements key=title from=$row}	
-					{if $title eq 'Attachment' && $elements.value != ''}
+					{if $elements.fldname eq 'filename' && $elements.value != ''}
 						<input type="button" name="download" value=" {$MOD.LBL_DOWNLOAD_ATTCH_BUTTON} " class="classWebBtn" onclick="fnvshobj(this,'reportLay')"/>
 					{/if}
 				{/foreach}
@@ -41,8 +41,8 @@
 <tr>
 	<td height="250" bgcolor="#FFFFFF" valign="top" style="padding-top:10px;">
 	{foreach item=row from=$BLOCKS}	
-	{foreach item=elements key=title from=$row}	
-		{if $title eq 'Subject'}
+	{foreach item=elements from=$row}	
+		{if $elements.fldname eq 'subject'}
 		<table width="100%" border="0" cellpadding="0" cellspacing="0">
 	{if $EMAIL_FLAG neq 'WEBMAIL'}
 	<tr><td width="20%" align="right" valign="top"><b>{$MOD.LBL_TO}</b></td><td width="2%">&nbsp;</td><td>{$TO_MAIL}&nbsp;</td></tr>
@@ -54,7 +54,7 @@
 	<tr><td align="right"><b>{$MOD.LBL_SUBJECT}</b></td><td>&nbsp;</td><td>{$elements.value}&nbsp;</td></tr>
 			<tr><td align="right" style="border-bottom:1px solid #666666;" colspan="3">&nbsp;</td></tr>
 		</table>
-		{elseif $title eq 'Description'}
+		{elseif $elements.fldname eq 'description'}
 		<div>
 			{$BLOCKS.4.Description.value}
 		</div>
@@ -66,7 +66,7 @@
 </table>
 {foreach item=row from=$BLOCKS}	
 	{foreach item=elements key=title from=$row}	
-	{if $title eq 'Attachment'}
+	{if $elements.fldname eq 'filename'}
 	<div id="reportLay" style="width:130px;" onmouseout="fninvsh('reportLay')" onmouseover="fnvshNrm('reportLay')">
 		<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">
 		{foreach item=attachments from=$elements.options}

Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Fri Jun 30 01:14:00 2006
@@ -1687,6 +1687,11 @@
                         return false;
                 }
 }
+function ShowEmail(id)
+{
+       url = 'index.php?module=Emails&action=EmailsAjax&file=DetailView&record='+id;
+       openPopUp('xComposeEmail',this,url,'createemailWin',820,652,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
+}
 
 var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
 var bOpera = (navigator.userAgent.indexOf('Opera') != -1);

Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Fri Jun 30 01:14:00 2006
@@ -696,7 +696,7 @@
 					{
 						$list_result_count = $i-1;
 						$tmp_value = getValue($ui_col_array,$list_result,$fieldname,$focus,$module,$entity_id,$list_result_count,"list","",$returnset,$oCv->setdefaultviewid);
-						$value = '<a href="javascript:;" onClick="OpenCompose(\''.$entity_id.'\',\'edit\');">'.$tmp_value.'</a>';
+						$value = '<a href="javascript:;" onClick="ShowEmail(\''.$entity_id.'\');">'.$tmp_value.'</a>';
 
 					}
 					else
@@ -2724,7 +2724,7 @@
 
 	$edit_link .= "&parenttab=".$_REQUEST["parenttab"];
 	if($module == 'Emails')
-	        $edit_link = 'javascript:;" onclick="OpenCompose(\'123\',\'edit\');';
+	        $edit_link = 'javascript:;" onclick="OpenCompose(\''.$entity_id.'\',\'edit\');';
 	return $edit_link;
 }
 

Modified: vtigercrm/trunk/modules/Emails/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/DetailView.php (original)
+++ vtigercrm/trunk/modules/Emails/DetailView.php Fri Jun 30 01:14:00 2006
@@ -45,9 +45,9 @@
 	$result = $adb->query($query);
     	$smarty->assign('FROM_MAIL',$adb->query_result($result,0,'from_email'));	
 	$to_email = ereg_replace('###',', ',$adb->query_result($result,0,'to_email'));
-	$smarty->assign('TO_MAIL',$to_email);	
-	$smarty->assign('CC_MAIL',ereg_replace('###',', ',$adb->query_result($result,0,'cc_email')));	
-    	$smarty->assign('BCC_MAIL',ereg_replace('###',', ',$adb->query_result($result,0,'bcc_email')));	
+	$smarty->assign('TO_MAIL',to_html($to_email));	
+	$smarty->assign('CC_MAIL',to_html(ereg_replace('###',', ',$adb->query_result($result,0,'cc_email'))));	
+    	$smarty->assign('BCC_MAIL',to_html(ereg_replace('###',', ',$adb->query_result($result,0,'bcc_email'))));	
     	$smarty->assign('EMAIL_FLAG',$adb->query_result($result,0,'email_flag'));	
 	if($focus->column_fields['name'] != '')
 	        $focus->name = $focus->column_fields['name'];		
@@ -131,14 +131,8 @@
 	else $smarty->assign("NAME", "");
 
 $entries = getBlocks($currentModule,"detail_view",'',$focus->column_fields);
-if($_REQUEST['mode'] != 'ajax')
-	$smarty->assign("BLOCKS" , $entries);
-else	
-{
-	$entries['Email Information']['4']['Description']['value'] = from_html($entries['Email Information']['4']['Description']['value']);
-	$smarty->assign("BLOCKS", $entries['Email Information']);
-}
-	
+$entries['Email Information']['4']['Description']['value'] = from_html($entries['Email Information']['4']['Description']['value']);
+$smarty->assign("BLOCKS", $entries['Email Information']);
 $smarty->assign("SINGLE_MOD",$app_strings['Email']);
 
 $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
@@ -157,7 +151,7 @@
 $smarty->assign("MODULE",$currentModule);
 $smarty->assign("SENDER",$email_id);
 if($_REQUEST['mode'] != 'ajax')
-	$smarty->display("DetailView.tpl");
+	$smarty->display("EmailDetailView.tpl");
 else
 	$smarty->display("EmailDetails.tpl")
 ?>





More information about the vtigercrm-commits mailing list