[Vtigercrm-commits] [vtiger-commits] r7371 - /vtigercrm/trunk/Smarty/templates/DisplayFields.tpl

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 21 07:39:03 EDT 2006


Author: richie
Date: Wed Jun 21 05:38:58 2006
New Revision: 7371

Log:
fixes #440

Modified:
    vtigercrm/trunk/Smarty/templates/DisplayFields.tpl

Modified: vtigercrm/trunk/Smarty/templates/DisplayFields.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DisplayFields.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DisplayFields.tpl Wed Jun 21 05:38:58 2006
@@ -450,7 +450,11 @@
 				{else}
 					<input name="{$fldname}"  type="file" value="{$maindata[3].0.name}" tabindex="{$vt_tab}" />
 					<input type="hidden" name="id" value=""/>
-					{$maindata[3].0.name}
+					{ if $maindata[3].0.name != "" }
+						
+				<div id="replaceimage">[{$maindata[3].0.name}] <a href="javascript:;" onClick="delimage({$ID})">Del</a></div>
+					{/if}
+					
 				{/if}
 			</td>
 
@@ -681,5 +685,21 @@
 				alert("Please enter Valid TAX value");
 	{rdelim}	
 
+function delimage(id)
+{ldelim}
+	new Ajax.Request(
+		'index.php',
+		{ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+			method: 'post',
+			postBody: 'module=Contacts&action=ContactsAjax&file=DelImage&recordid='+id,
+			onComplete: function(response)
+				    {ldelim}
+					$("replaceimage").innerHTML=response.responseText;
+				    {rdelim}
+		{rdelim}
+	);
+
+{rdelim}
+
 
 </script>





More information about the vtigercrm-commits mailing list