[Vtigercrm-commits] [vtiger-commits] r3910 - in /vtigercrm/trunk: Smarty/templates/CreateView.tpl Smarty/templates/salesEditView.tpl include/RelatedListView.php modules/uploads/add2db.php modules/uploads/upload.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Feb 23 11:55:30 EST 2006


Author: saraj
Date: Thu Feb 23 09:55:20 2006
New Revision: 3910

Log:
multipleuploads has been integrated for attachments and the storage location has been changed

Modified:
    vtigercrm/trunk/Smarty/templates/CreateView.tpl
    vtigercrm/trunk/Smarty/templates/salesEditView.tpl
    vtigercrm/trunk/include/RelatedListView.php
    vtigercrm/trunk/modules/uploads/add2db.php
    vtigercrm/trunk/modules/uploads/upload.php

Modified: vtigercrm/trunk/Smarty/templates/CreateView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CreateView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CreateView.tpl Thu Feb 23 09:55:20 2006
@@ -451,10 +451,27 @@
 								<textarea name="{$fldname}" cols="30" rows="2">{$fldvalue}</textarea>
                                                  </td>
 
-						{elseif $uitype eq 69 || $uitype eq 61}
+						{elseif $uitype eq 69}
 						<td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
-						<td colspan="3" width="30%" align=left class="dvtCellInfo"><input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
-
+						<td colspan="3" width="30%" align=left class="dvtCellInfo">
+						{if $MODULE eq 'Products'}
+							<input name="imagelist" type="hidden" value="">
+						    <div id="files_list" style="border: 1px solid grey; width: 500px; padding: 5px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-size: x-small">Files Maximum 6
+						    <input id="my_file_element" type="file" name="file_1" >
+                            </div>
+                            <script>
+                            {*<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->*}
+                            var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 6 );
+                            {*<!-- Pass in the file element -->*}
+                            multi_selector.addElement( document.getElementById( 'my_file_element' ) );
+                            </script>
+	                     </td>
+                         {else}
+                         <input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
+                         {/if}
+                         {elseif $uitype eq 61}
+                         <td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
+						 <td colspan="3" width="30%" align=left class="dvtCellInfo"><input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
 						{elseif $uitype eq 30}
                                                 <td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
                                                 <td colspan="3" width="30%" align=left class="dvtCellInfo">
@@ -823,9 +840,27 @@
 								<textarea name="{$fldname}" cols="30" rows="2">{$fldvalue}</textarea>
                                                  </td>
 
-						{elseif $uitype eq 69 || $uitype eq 61}
+						{elseif $uitype eq 69}
 						<td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
-						<td colspan="3" width="30%" align=left class="dvtCellInfo"><input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
+						<td colspan="3" width="30%" align=left class="dvtCellInfo">
+						{if $MODULE eq 'Products'}
+							<input name="imagelist" type="hidden" value="">
+						    <div id="files_list" style="border: 1px solid grey; width: 500px; padding: 5px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-size: x-small">Files Maximum 6
+						    <input id="my_file_element" type="file" name="file_1" >
+                            </div>
+                            <script>
+                            {*<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->*}
+                            var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 6 );
+                            {*<!-- Pass in the file element -->*}
+                            multi_selector.addElement( document.getElementById( 'my_file_element' ) );
+                            </script>
+	                     </td>
+                         {else}
+                         <input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
+                         {/if}
+                         {elseif $uitype eq 61}
+                         <td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
+						 <td colspan="3" width="30%" align=left class="dvtCellInfo"><input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
 
 						{elseif $uitype eq 30}
                                                 <td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
@@ -865,7 +900,7 @@
                                                                 <input title="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_KEY}" class="small" onclick="window.open('index.php?module=Users&action=lookupemailtemplates&entityid={$ENTITY_ID}&entity={$ENTITY_TYPE}','emailtemplate','top=100,left=200,height=400,width=300,menubar=no,addressbar=no,status=yes')" type="button" name="button" value="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL}">
                                                                 <input title="{$MOD.LBL_SEND}" accessKey="{$MOD.LBL_SEND}" class="small" onclick="this.form.action.value='Save';this.form.send_mail.value='true'; return formValidate()" type="submit" name="button" value="  {$MOD.LBL_SEND}  " >
                                                                 {/if}
-                                                                <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="small" onclick="this.form.action.value='Save';  return formValidate()" type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " style="width:70px" >
+                                                                <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="small" onclick="this.form.action.value='Save';return formValidate()" type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " style="width:70px" >
                                                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="small" onclick="window.history.back()" type="button" name="button" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  " style="width:70px">
 								</div>
 								</td>
@@ -884,6 +919,25 @@
 </form>
 <script>
 
+{if ($MODULE eq 'Emails' || 'Notes') and ($FCKEDITOR_DISPLAY eq 'true')}
+       <script type="text/javascript" src="include/fckeditor/fckeditor.js"></script>
+       <script type="text/javascript" defer="1">
+
+       var oFCKeditor = null;
+
+       {if $MODULE eq 'Emails'}
+               oFCKeditor = new FCKeditor( "description" ) ;
+       {/if}
+       {if $MODULE eq 'Notes'}
+               oFCKeditor = new FCKeditor( "notecontent" ) ;
+       {/if}
+
+       oFCKeditor.BasePath   = "include/fckeditor/" ;
+       oFCKeditor.ReplaceTextarea() ;
+
+       </script>
+{/if}
+
 
 
         var fieldname = new Array({$VALIDATION_DATA_FIELDNAME})
@@ -892,5 +946,6 @@
 
         var fielddatatype = new Array({$VALIDATION_DATA_FIELDDATATYPE})
 
+
 </script>
 

Modified: vtigercrm/trunk/Smarty/templates/salesEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/salesEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/salesEditView.tpl Thu Feb 23 09:55:20 2006
@@ -150,8 +150,8 @@
 							<tr>
 								<td  colspan=4 style="padding:5px">
 								<div align="center">
-								<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="small" onclick="this.form.action.value='Save';  return formValidate()" type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " style="width:70px" >
-                                                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="small" onclick="window.history.back()" type="button" name="button" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  " style="width:70px">
+								<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="small" onclick="this.form.action.value='Save'; displaydeleted(); return formValidate()" type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " style="width:70px" >
+                                <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="small" onclick="window.history.back()" type="button" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}  " style="width:70px">
 								</div>
 								</td>
 							</tr>
@@ -453,9 +453,35 @@
 								<textarea name="{$fldname}" cols="30" rows="2">{$fldvalue}</textarea>
                                                  </td>
 
-						{elseif $uitype eq 69 || $uitype eq 61}
+						{elseif $uitype eq 69}
 						<td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
-						<td colspan="3" width="30%" align=left class="dvtCellInfo"><input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
+						<td colspan="3" width="30%" align=left class="dvtCellInfo">
+						{if $MODULE eq 'Products'}
+						     <input name="imagelist" type="hidden" value="">
+						     <div id="files_list" style="border: 1px solid grey; width: 500px; padding: 5px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-size: x-small">Files Maximum 6
+						     <input id="my_file_element" type="file" name="file_1" >
+                             {foreach key=num item=image from=$maindata[3]}
+                             {if $image neq ''}
+                                <div align="center">
+                                <img src="test/product/{$image}" height="50">&nbsp;&nbsp;[{$image}]<input id="file_{$num}" value="Delete" type="button" onclick='this.parentNode.parentNode.removeChild(this.parentNode);delRowEmt("{$image}")'>
+                                </div>
+                             {/if}
+                             {/foreach}
+                             </div>
+                             <script>
+                             {*<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->*}
+                             var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 6 );
+                             {*<!-- Pass in the file element -->*}
+                             multi_selector.addElement( document.getElementById( 'my_file_element' ) );
+                             </script>
+                             </td>
+						{else}
+						<input name="{$fldname}"  type="file" value="{$secondvalue}"/><input type="hidden" name="id" value=""/>{$fldvalue}</td>
+                        {/if}
+                        {elseif $uitype eq 61}
+	                        <td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
+							<td colspan="3" width="30%" align=left class="dvtCellInfo"><input name="{$fldname}"  type="file" value="{$secondvalue}"/>
+							<input type="hidden" name="id" value=""/>{$fldvalue}</td>
 
 						{elseif $uitype eq 30}
                                                 <td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
@@ -495,7 +521,7 @@
                                                                 <input title="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_KEY}" class="small" onclick="window.open('index.php?module=Users&action=lookupemailtemplates&entityid={$ENTITY_ID}&entity={$ENTITY_TYPE}','emailtemplate','top=100,left=200,height=400,width=300,menubar=no,addressbar=no,status=yes')" type="button" name="button" value="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL}">
                                                                 <input title="{$MOD.LBL_SEND}" accessKey="{$MOD.LBL_SEND}" class="small" onclick="this.form.action.value='Save';this.form.send_mail.value='true'; return formValidate()" type="submit" name="button" value="  {$MOD.LBL_SEND}  " >
                                                                 {/if}
-                                                                <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="small" onclick="this.form.action.value='Save';  return formValidate()" type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " style="width:70px" >
+                                                                <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="small" onclick="this.form.action.value='Save';  displaydeleted();return formValidate()" type="submit" name="button" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  " style="width:70px" >
                                                                 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="small" onclick="window.history.back()" type="button" name="button" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  " style="width:70px">
 								</div>
 								</td>
@@ -514,12 +540,39 @@
 	ScrollEffect.limit = 201;
 	ScrollEffect.closelimit= 200;
 	
-
+{if ($MODULE eq 'Emails' || 'Notes') and ($FCKEDITOR_DISPLAY eq 'true')}
+     <script type="text/javascript" src="include/fckeditor/fckeditor.js"></script>
+	 <script type="text/javascript" defer="1">
+     var oFCKeditor = null;
+	 {if $MODULE eq 'Emails'}
+          oFCKeditor = new FCKeditor( "description" ) ;
+     {/if}
+	 {if $MODULE eq 'Notes'}
+	          oFCKeditor = new FCKeditor( "notecontent" ) ;
+	 {/if}
+     oFCKeditor.BasePath   = "include/fckeditor/" ;
+	 oFCKeditor.ReplaceTextarea() ;
+{/if}
 
         var fieldname = new Array({$VALIDATION_DATA_FIELDNAME})
 
         var fieldlabel = new Array({$VALIDATION_DATA_FIELDLABEL})
 
         var fielddatatype = new Array({$VALIDATION_DATA_FIELDDATATYPE})
+var ProductImages=new Array();
+var count=0;
+function delRowEmt(imagename)
+{ldelim}
+       ProductImages[count++]=imagename;
+{rdelim}
+function displaydeleted()
+{ldelim}
+       var imagelists='';
+       for(var x = 0; x < ProductImages.length; x++)
+       {ldelim}
+               imagelists+=ProductImages[x]+'###';
+       {rdelim}
+       document.EditView.imagelist.value=imagelists
+{rdelim}
 
 </script>

Modified: vtigercrm/trunk/include/RelatedListView.php
==============================================================================
Binary files - no diff available.

Modified: vtigercrm/trunk/modules/uploads/add2db.php
==============================================================================
--- vtigercrm/trunk/modules/uploads/add2db.php (original)
+++ vtigercrm/trunk/modules/uploads/add2db.php Thu Feb 23 09:55:20 2006
@@ -11,105 +11,105 @@
 
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
-
+global $current_user;
 $vtigerpath = $_SERVER['REQUEST_URI'];
 $vtigerpath = str_replace("/index.php?module=uploads&action=add2db", "", $vtigerpath);
-$uploaddir = $root_directory ."/test/upload/" ;// set this to wherever
+$directory = $root_directory."/storage/user_".getUserName($current_user->id)."/attachments/";
 
-// Arbitrary File Upload Vulnerability fix - Philip
-$binFile = $_FILES['binFile']['name'];
+if(!is_dir($directory))
+{
+	if(!mkdir($directory, 0777))	
+	{
+		echo "Access denined to create folder";
+		die;
+	}
+}
+$uploaddir = $directory;
+$crmid = $_REQUEST['return_id'];
+
+for ($filecount=0;$filecount<count($_FILES) && $_FILES['file_'.$filecount]!='';$filecount++)
+{
+	// Arbitrary File Upload Vulnerability fix - Philip
+	$binFile = $_FILES['file_'.$filecount]['name'];
 
 	$ext_pos = strrpos($binFile, ".");
 
-        $ext = substr($binFile, $ext_pos + 1);
+	$ext = substr($binFile, $ext_pos + 1);
 
-        if (in_array($ext, $upload_badext))
-        {
-                $binFile .= ".txt";
-        }
+	if (in_array($ext, $upload_badext))
+	{
+		$binFile .= ".txt";
+	}
 
-$_FILES["binFile"]["name"] = $binFile;
-// Vulnerability fix ends
+	$_FILES["file_".$filecount]["name"] = $binFile;
+	// Vulnerability fix ends
 
-if(move_uploaded_file($_FILES["binFile"]["tmp_name"],$uploaddir.$_FILES["binFile"]["name"])) 
-{
-	$filename = basename($binFile);
-	$filetype= $_FILES['binFile']['type'];
-	$filesize = $_FILES['binFile']['size'];
+	if(move_uploaded_file($_FILES["file_".$filecount]["tmp_name"],$uploaddir.$crmid."_".$_FILES["file_".$filecount]["name"])) 
+	{
+		$filename = $crmid.'_'.basename($binFile);
+		$filetype= $_FILES['file_'.$filecount]['type'];
+		$filesize = $_FILES['file_'.$filecount]['size'];
 
-	if($filesize != 0)	
+		if($filesize != 0)	
+		{
+			$current_id = $adb->getUniqueID("crmentity");
+			$desc = $_REQUEST['txtDescription'];
+			$description = addslashes($desc);
+			$date_var = date('YmdHis');
+
+			$query = "insert into crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime) values('";
+			$query .= $current_id."','".$current_user->id."','".$current_user->id."','".$_REQUEST['return_module'].' Attachment'."','".$description."','".$date_var."')";
+			$result = $adb->query($query);
+
+			$sql = "insert into attachments values(";
+			$sql .= $current_id.",'".$filename."','".$description."','".$filetype."')";
+			$result = $adb->query($sql);
+
+
+			$sql1 = "insert into seattachmentsrel values('";
+			$sql1 .= $crmid."','".$current_id."')";
+			$result = $adb->query($sql1);
+
+			header("Location: index.php?action=".$_REQUEST['return_action']."&module=".$_REQUEST['return_module']."&record=".$_REQUEST['return_id']."&filename=".$filename."");
+		}
+		else
+		{
+			include('themes/'.$theme.'/header.php');
+			$errormessage = "<font color='red'><B>Error Message<ul>
+				<li><font color='red'>Invalid file OR</font>
+				<li><font color='red'>File has no data</font>
+				</ul></B></font> <br>" ;
+			echo $errormessage;
+			include "upload.php";
+		}			
+	} 
+	else 
 	{
-		$current_id = $adb->getUniqueID("crmentity");
-		$desc = $_REQUEST['txtDescription'];
-		$description = addslashes($desc);
-		$date_var = date('YmdHis');
+		$errorCode =  $_FILES['binFile']['error'];
 
-		$data = base64_encode(fread(fopen($uploaddir.$binFile, "r"), $filesize));
-		//$data = addslashes(fread(fopen($uploaddir.$binFile, "r"), $filesize));
-		
-		$query = "insert into crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime) values('";
-		$query .= $current_id."','".$current_user->id."','".$current_user->id."','".$_REQUEST['return_module'].' Attachment'."','".$description."','".$date_var."')";
-		$result = $adb->query($query);
+		if($errorCode == 4)
+		{
+			include('themes/'.$theme.'/header.php');
+			$errormessage = "<B><font color='red'>Kindly give a valid file for upload!</font></B> <br>" ;
+			echo $errormessage;
+			include "upload.php";
+		}
+		else if($errorCode == 2)
+		{
+			$errormessage = "<B><font color='red'>Sorry, the uploaded file exceeds the maximum filesize limit. Please try a file smaller than 1000000 bytes</font></B> <br>";
+			include('themes/'.$theme.'/header.php');
+			echo $errormessage;
+			include "upload.php";
+			//echo $errorCode;
+		}
+		else if($errorCode == 3 || $errorcode == '')
+		{
+			include('themes/'.$theme.'/header.php');
+			echo "<b><font color='red'>Problems in file upload. Please try again!</font></b><br>";
+			include "upload.php";
+		}
 
-		$sql = "insert into attachments values(";
-		$sql .= $current_id.",'".$filename."','".$description."','".$filetype."','".$filesize."','".$adb->getEmptyBlob()."')";
-		$result = $adb->query($sql);
-	
-		if($result!=false)	    
-			$result = $adb->updateBlob('attachments','attachmentcontents',"attachmentsid='".$current_id."' and name='".$filename."'",$data);
-	
+	}
 
-		$crmid = $_REQUEST['return_id'];
-
-		$sql1 = "insert into seattachmentsrel values('";
-		$sql1 .= $crmid."','".$current_id."')";
-
-		$result = $adb->query($sql1);
-header("Location: index.php?action=".$_REQUEST['return_action']."&module=".$_REQUEST['return_module']."&record=".$_REQUEST['return_id']."&filename=".$filename."");
-	}
-	else
-	{
-		include('themes/'.$theme.'/header.php');
-		$errormessage = "<font color='red'><B>Error Message<ul>
-			<li><font color='red'>Invalid file OR</font>
-			<li><font color='red'>File has no data</font>
-			</ul></B></font> <br>" ;
-		echo $errormessage;
-		deleteFile($uploaddir,$filename);
-		include "upload.php";
-	}			
-} 
-else 
-{
-	$errorCode =  $_FILES['binFile']['error'];
-	
-	if($errorCode == 4)
-	{
-	    include('themes/'.$theme.'/header.php');
-	    $errormessage = "<B><font color='red'>Kindly give a valid file for upload!</font></B> <br>" ;
-	    echo $errormessage;
-	    include "upload.php";
-	}
-	else if($errorCode == 2)
-	{
-	    $errormessage = "<B><font color='red'>Sorry, the uploaded file exceeds the maximum filesize limit. Please try a file smaller than 1000000 bytes</font></B> <br>";
-	    include('themes/'.$theme.'/header.php');
-	    echo $errormessage;
-	    include "upload.php";
-	    //echo $errorCode;
-	}
-	else if($errorCode == 3 || $errorcode == '')
-	{
-	    include('themes/'.$theme.'/header.php');
-	    echo "<b><font color='red'>Problems in file upload. Please try again!</font></b><br>";
-	    include "upload.php";
-	}
-	  
 }
-	
-function deleteFile($dir,$filename)
-{
-   unlink($dir.$filename);	
-}
-
 ?>

Modified: vtigercrm/trunk/modules/uploads/upload.php
==============================================================================
--- vtigercrm/trunk/modules/uploads/upload.php (original)
+++ vtigercrm/trunk/modules/uploads/upload.php Thu Feb 23 09:55:20 2006
@@ -10,6 +10,7 @@
 -->
 <HTML>
 <BODY>
+<script type='text/javascript' src='modules/Products/multifile.js'></script>
 <FORM METHOD="post" action="index.php?module=uploads&action=add2db&return_module=<?php echo $_REQUEST['return_module']?>" enctype="multipart/form-data">
 <?php
 	$ret_action = $_REQUEST['return_action'];
@@ -36,7 +37,26 @@
 		  <TD class="dataLabel" width="25%">
 			<div align="right"><font class="required">*</font> <?php echo $mod_strings['LBL_FILENAME']; ?> </div>
 		  </TD>
-        	  <TD><INPUT TYPE="file" NAME="binFile"></TD>
+        	  <TD>
+			  <input name="imagelist" type="hidden" value="">
+			  <div id="files_list" style="border: 1px solid grey; width: 500px; padding: 5px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-size: x-small">Files Maximum 6
+			  <input id="my_file_element" type="file" name="file_1" >
+			<!--{foreach key=num item=image from=$maindata[3]}
+			{if $image neq ''}
+			<div align="center">
+			<img src="test/product/{$image}" height="50">&nbsp;&nbsp;[{$image}]<input id="file_{$num}" v
+			alue="Delete" type="button" onclick='this.parentNode.parentNode.removeChild(this.parentNode);delRowEmt("{$image}")'>
+			</div>
+			{/if}
+			{/foreach}-->
+<script>
+	<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->
+	var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 6 );
+	<!-- Pass in the file element -->
+	multi_selector.addElement( document.getElementById( 'my_file_element' ) );
+</script>
+
+			  <!--<INPUT TYPE="file" NAME="binFile"></TD>-->
 	      </TR>
               <TR> 
           	  <TD class="dataLabel" width="25%" valign="top" >





More information about the vtigercrm-commits mailing list