[Vtigercrm-commits] [vtiger-commits] r7570 - in /vtigercrm/trunk: Smarty/templates/EmailDetails.tpl include/utils/DetailViewUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Jun 27 07:28:28 EDT 2006


Author: richie
Date: Tue Jun 27 05:28:23 2006
New Revision: 7570

Log:
multiple attachments shown in Emails detailview

Modified:
    vtigercrm/trunk/Smarty/templates/EmailDetails.tpl
    vtigercrm/trunk/include/utils/DetailViewUtils.php

Modified: vtigercrm/trunk/Smarty/templates/EmailDetails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/EmailDetails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/EmailDetails.tpl Tue Jun 27 05:28:23 2006
@@ -67,14 +67,15 @@
 {foreach item=row from=$BLOCKS}	
 	{foreach item=elements key=title from=$row}	
 	{if $title eq 'Attachment'}
-	<div id="reportLay" onmouseout="fninvsh('reportLay')" onmouseover="fnvshNrm('reportLay')">
+	<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}
 		<tr>
-			<td>
-				{$elements.value}
+			<td style="border-bottom: 1px solid rgb(204, 204, 204); padding: 5px;">
+				{$attachments}
 			</td>
 		</tr>
-		<tr><td style="padding:5px;">&nbsp;</td></tr>
+		{/foreach}
 		</table>
 	</div>
 	{/if}

Modified: vtigercrm/trunk/include/utils/DetailViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/DetailViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/DetailViewUtils.php Tue Jun 27 05:28:23 2006
@@ -346,26 +346,45 @@
 		
 	}
         elseif($uitype == 61)
-        {
-                global $adb;
-
-                $attachmentid=$adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid = ".$col_fields['record_id']),0,'attachmentsid');
-		if($col_fields[$fieldname] == '' && $attachmentid != '')
-		{
-				$attachquery = "select * from vtiger_attachments where attachmentsid=".$attachmentid;
-        		        $col_fields[$fieldname] = $adb->query_result($adb->query($attachquery),0,'name');
-		}
-
-		//This is added to strip the crmid and _ from the file name and show the original filename
-		$org_filename = ltrim($col_fields[$fieldname],$col_fields['record_id'].'_');
-		if($org_filename != '')
-        	$custfldval = '<a href = "index.php?module=uploads&action=downloadfile&return_module='.$col_fields['record_module'].'&fileid='.$attachmentid.'&entityid='.$col_fields['record_id'].'">'.$org_filename.'</a>';
-		else
-			$custfldval = '';
-		$label_fld[] =$mod_strings[$fieldlabel];
-
-		$label_fld[] =$custfldval;
-        }
+		{
+			global $adb;
+			$label_fld[] =$mod_strings[$fieldlabel];
+
+			if($tabid ==10)
+			{
+				$attach_result = $adb->query("select * from vtiger_seattachmentsrel where crmid = ".$col_fields['record_id']);
+				for($ii=0;$ii < $adb->num_rows($attach_result);$ii++)
+				{
+					$attachmentid = $adb->query_result($attach_result,0,'attachmentsid');
+					if($attachmentid != '')
+					{
+						$attachquery = "select * from vtiger_attachments where attachmentsid=".$attachmentid;
+						$attachmentsname = $adb->query_result($adb->query($attachquery),0,'name');
+						if($attachmentsname != '')	
+							$custfldval = '<a href = "index.php?module=uploads&action=downloadfile&return_module='.$col_fields['record_module'].'&fileid='.$attachmentid.'&entityid='.$col_fields['record_id'].'">'.$attachmentsname.'</a>';
+						else
+							$custfldval = '';
+					}
+					$label_fld['options'][] = $custfldval;
+				}
+			}else
+			{
+				$attachmentid=$adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid = ".$col_fields['record_id']),0,'attachmentsid');
+				if($col_fields[$fieldname] == '' && $attachmentid != '')
+				{
+					$attachquery = "select * from vtiger_attachments where attachmentsid=".$attachmentid;
+					$col_fields[$fieldname] = $adb->query_result($adb->query($attachquery),0,'name');
+				}
+
+				//This is added to strip the crmid and _ from the file name and show the original filename
+				$org_filename = ltrim($col_fields[$fieldname],$col_fields['record_id'].'_');
+				if($org_filename != '')
+					$custfldval = '<a href = "index.php?module=uploads&action=downloadfile&return_module='.$col_fields['record_module'].'&fileid='.$attachmentid.'&entityid='.$col_fields['record_id'].'">'.$org_filename.'</a>';
+				else
+					$custfldval = '';
+			}
+			$label_fld[] =$custfldval;
+		}
 	elseif($uitype == 69)
 	{
 		$label_fld[] =$mod_strings[$fieldlabel];





More information about the vtigercrm-commits mailing list