[Vtigercrm-commits] [vtiger-commits] r7460 - in /vtigercrm/trunk: Smarty/templates/ modules/Settings/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Jun 23 06:02:37 EDT 2006


Author: saraj
Date: Fri Jun 23 04:02:27 2006
New Revision: 7460

Log:
New UI Integrated for Custom Field

Modified:
    vtigercrm/trunk/Smarty/templates/CustomFieldEntries.tpl
    vtigercrm/trunk/Smarty/templates/CustomFieldList.tpl
    vtigercrm/trunk/Smarty/templates/CustomFieldMapping.tpl
    vtigercrm/trunk/Smarty/templates/SetMenu.tpl
    vtigercrm/trunk/Smarty/templates/Settings.tpl
    vtigercrm/trunk/modules/Settings/CustomFieldList.php
    vtigercrm/trunk/modules/Settings/LeadCustomFieldMapping.php
    vtigercrm/trunk/modules/Settings/SaveConvertLead.php

Modified: vtigercrm/trunk/Smarty/templates/CustomFieldEntries.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CustomFieldEntries.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CustomFieldEntries.tpl Fri Jun 23 04:02:27 2006
@@ -8,52 +8,53 @@
  * All Rights Reserved.
 *
  ********************************************************************************/ *}
-				<table width="100%"><tr>
-					<td align="right" valign="top" width="5%" rowspan="2"><img src="{$IMAGE_PATH}two.gif" width="29" height="31" /></td>
-					<td>
-						<b class="lvtHeaderText">{$MOD.CustomFields} in {$MODULE}</b>
-					</td>
+				<form action="index.php" method="post" name="form">
+				<input type="hidden" name="fld_module" value="{$MODULE}">
+				<input type="hidden" name="module" value="Settings">
+				<input type="hidden" name="parenttab" value="Settings">
+				<input type="hidden" name="mode">
+				<table class="listTableTopButtons" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+					<td class="small">&nbsp;</td>
+					<td class="small" align="right">&nbsp;&nbsp;
+					{if $MODULE eq 'Leads'}
+					&nbsp;&nbsp;<input input title="{$MOD.CUSTOMFIELDMAPPING}"  class="crmButton edit small" onclick="CustomFieldMapping();" type="button" name="ListLeadCustomFieldMapping" value="{$MOD.CUSTOMFIELDMAPPING}">
+					{/if}
+					<input type="button" value=" {$MOD.NewCustomField} " onClick="getCreateCustomFieldForm('{$MODULE}','','','')" class="crmButton create small"/>
 				</tr>
-				<tr>
-					<td>
-						<form action="index.php" method="post" name="form">
-						<input type="hidden" name="fld_module" value="{$MODULE}">
-						<input type="hidden" name="module" value="Settings">
-						<input type="hidden" name="parenttab" value="Settings">
-						<input type="hidden" name="mode">
-						<table width="95%" border="0" cellpadding="5" cellspacing="0">
-							<tr><td align="right"><input type="button" value=" {$MOD.NewCustomField} " onClick="getCreateCustomFieldForm('{$MODULE}','','','')" class="classBtn"/></td></tr>
-						</table>
-						<table style="background-color: rgb(204, 204, 204);" class="small" border="0" cellpadding="5" cellspacing="1" width="95%">
-						<tbody>
-							<tr>
-								<td class="lvtCol" width="5%">#</td>
-							        <td class="lvtCol" width="35%">{$MOD.FieldLabel}</td>
-							        <td class="lvtCol" width="50%">{$MOD.FieldType}</td>
-								<td class="lvtCol" width="10%">{$MOD.LBL_CURRENCY_TOOL}</td>
-							</tr>
-							{foreach item=entries key=id from=$CFENTRIES}
-							<tr class="lvtColData" onmouseover="this.className='lvtColDataHover'" onmouseout="this.className='lvtColData'" bgcolor="white">
-								{foreach item=value from=$entries}
-									<td nowrap>{$value}</td>
-								{/foreach}
-							</tr>
-							{/foreach}
-						</tbody>
-						</table><br />
-						{if $MODULE eq 'Leads'}
-						<table width="35%" style="border:1px dashed #CCCCCC;background-color:#FFFFEC;" cellpadding="5" cellspacing="0">
-							<tr>
-								<td style="padding:5px;" width="5%" >
-								<img src="{$IMAGE_PATH}mapping.gif" align="absmiddle" /> </td>
-								<td><span  class="genHeaderSmall">{$MOD.LBL_FIELD_MAPPING}</span><br />
-								{$MOD.LBL_FIELD_MAPPING} {$MOD.LBL_CUSTM_MSG} 
-								</td>
-							</tr>
-							<tr><td colspan="2" align="right"><input input title="{$MOD.CUSTOMFIELDMAPPING}"  class="classBtn" onclick="CustomFieldMapping();" type="button" name="ListLeadCustomFieldMapping" value="{$MOD.CUSTOMFIELDMAPPING}"></td></tr>
-						</table> 
-						{/if}
-					</form>
-					</td>
-				</tr></table>
+				</table>
 
+				<table class="listTable" border="0" cellpadding="5" cellspacing="0" width="100%">
+					{if $MODULE eq 'Leads'}
+					<tr>
+						<td rowspan="2" class="colHeader small" width="5%">#</td>
+					        <td rowspan="2" class="colHeader small" width="20%">{$MOD.FieldLabel}</td>
+					        <td rowspan="2" class="colHeader small" width="20%">{$MOD.FieldType}</td>
+							<td colspan="3" class="colHeader small" valign="top"><div align="center">{$MOD.LBL_MAPPING_OTHER_MODULES}</div></td>
+					        <td rowspan="2" class="colHeader small" width="20%">{$MOD.LBL_CURRENCY_TOOL}</td>
+				      </tr>
+
+					<tr>
+					  <td class="colHeader small" valign="top" width="18%">Accounts</td>
+					  <td class="colHeader small" valign="top" width="18%">Contacts</td>
+					  <td class="colHeader small" valign="top" width="19%">Potentials</td>
+					</tr>
+					{else}
+					<tr>
+                      	<td class="colHeader small" width="5%">#</td>
+                      	<td class="colHeader small" width="20%">{$MOD.FieldLabel}</td>
+                      	<td class="colHeader small" width="20%">{$MOD.FieldType}</td>
+                     	<td class="colHeader small" width="20%">{$MOD.LBL_CURRENCY_TOOL}</td>
+					</tr>
+					{/if}
+					{foreach item=entries key=id from=$CFENTRIES}
+					<tr>
+						{foreach item=value from=$entries}
+							<td class="listTableRow small" valign="top" nowrap>{$value}</td>
+						{/foreach}
+					</tr>
+					{/foreach}
+		</table>
+		</form>
+		<br>
+		<strong>{$APP.LBL_NOTE}: </strong> {$MOD.LBL_CUSTOM_MAPP_INFO}

Modified: vtigercrm/trunk/Smarty/templates/CustomFieldList.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CustomFieldList.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CustomFieldList.tpl Fri Jun 23 04:02:27 2006
@@ -10,23 +10,23 @@
  ********************************************************************************/ *}
 <script language="JavaScript" type="text/javascript" src="include/js/customview.js"></script>
 <script language="javascript">
-{literal}
-
 function getCustomFieldList(customField)
-{
+{ldelim}
 	var modulename = customField.options[customField.options.selectedIndex].value;
+	$('module_info').innerHTML = '{$MOD.LBL_CUSTOM_FILED_IN} "'+modulename+'" {$APP.LBL_MODULE}';
 	new Ajax.Request(
 		'index.php',
-		{queue: {position: 'end', scope: 'command'},
+		{ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
 			method: 'post',
 			postBody: 'module=Settings&action=SettingsAjax&file=CustomFieldList&fld_module='+modulename+'&parenttab=Settings&ajax=true',
-			onComplete: function(response) {
+			onComplete: function(response) {ldelim}
 				$("cfList").innerHTML=response.responseText;
-			}
-		}
+			{rdelim}
+		{rdelim}
 	);	
-}
+{rdelim}
 
+{literal}
 function deleteCustomField(id, fld_module, colName, uitype)
 {
         if(confirm("Are you sure?"))
@@ -60,49 +60,78 @@
 {/literal}
 </script>
 <div id="createcf" style="display:block;position:absolute;top:175px;left:275px;"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-        {include file='SettingsMenu.tpl'}
-<td width="75%" valign="top">
-<b><font color=red>{$DUPLICATE_ERROR} </font></b>
-<table width="99%" border="0" cellpadding="0" cellspacing="0" align="center">
-	<tr>
-		<td class="showPanelBg" valign="top" style="padding-left:20px; "><br />
-	       	        <span class="lvtHeaderText">{$MOD.LBL_SETTINGS} &gt; {$MOD.LBL_STUDIO} &gt; {$MOD.LBL_CUSTOM_FIELD_SETTINGS} </span>
-        	        <hr noshade="noshade" size="1" />
+<br>
+<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
+<tbody><tr>
+        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
+        <td class="showPanelBg" style="padding: 10px;" valign="top" width="100%">
+        <br>
+
+	<div align=center>
+			{include file='SetMenu.tpl'}
+			<!-- DISPLAY -->
+			<b><font color=red>{$DUPLICATE_ERROR} </font></b>
+			
+				<table class="settingsSelUITopLine" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tbody><tr>
+					<td rowspan="2" valign="top" width="50"><img src="{$IMAGE_PATH}custom.gif" alt="Users" title="Users" border="0" height="48" width="48"></td>
+					<td class="heading2" valign="bottom"><b>{$MOD.LBL_SETTINGS} &gt; {$MOD.LBL_STUDIO} &gt; {$MOD.LBL_CUSTOM_FIELD_SETTINGS}</b></td>
+				</tr>
+
+				<tr>
+					<td class="small" valign="top">{$MOD.LBL_CREATE_AND_MANAGE_USER_DEFINED_FIELDS}</td>
+				</tr>
+				</tbody></table>
+				
+				<br>
+				<table border="0" cellpadding="10" cellspacing="0" width="100%">
+				<tbody><tr>
+				<td>
+
+				<table class="tableHeading" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tbody><tr>
+					<td class="big" nowrap><strong><span id="module_info">{$MOD.LBL_CUSTOM_FILED_IN} "{$APP.$MODULE}" {$APP.LBL_MODULE}</span></strong> </td>
+					<td class="small" align="right">
+					{$MOD.LBL_SELECT_CF_TEXT}
+		                	<select name="pick_module" class="importBox" onChange="getCustomFieldList(this)">
+                		        {foreach key=sel_value item=value from=$MODULES}
+		                        {if $MODULE eq $sel_value}
+                	                       	{assign var = "selected_val" value="selected"}
+		                        {else}
+                        	                {assign var = "selected_val" value=""}
+                                	{/if}
+	                                <option value="{$sel_value}" {$selected_val}>{$APP.$value}</option>
+        		                {/foreach}
+			                </select>
+					</td>
+					</tr>
+				</tbody>
+				</table>
+				<div id="cfList">
+                                {include file="CustomFieldEntries.tpl"}
+                </div>	
+			<table border="0" cellpadding="5" cellspacing="0" width="100%">
+			<tr>
+
+		  	<td class="small" align="right" nowrap="nowrap"><a href="#top">[Scroll to Top]</a></td>
+			</tr>
+			</table>
+			</td>
+			</tr>
+			</table>
+		<!-- End of Display -->
+		
 		</td>
-	</tr>
-	
-	<tr><td>&nbsp;</td></tr>
-	<tr>
-		<td>
-			<table width="95%" cellpadding="5" cellspacing="0" class="leadTable" align="center">
-				<tr>
-					<td style="padding:5px;border-bottom:2px dotted #CCCCCC;" width="5%" >
-						<img src="{$IMAGE_PATH}mapping.gif" align="left" />
-					</td>
-					<td style="padding:5px;border-bottom:2px dotted #AAAAAA;">
-						<span class="genHeaderGrayBig">{$MOD.LBL_CUSTOM_FIELD_SETTINGS}</span>
-						<br />
-						<span class="big">{$MOD.LBL_CREATE_AND_MANAGE_USER_DEFINED_FIELDS}</span>
-					</td>
-				</tr>
-				<tr><td colspan="2">&nbsp;</td></tr>
-				{include file="CustomFieldCombo.tpl"}
-				<tr><td colspan="2">&nbsp;</td></tr>
-				<tr><td colspan ="2">
-				
-						<div id="cfList">
-				{include file="CustomFieldEntries.tpl"}					
-						</div>
+        </tr>
+        </table>
+        </td>
+        </tr>
+        </table>
+        </div>
 
-				</td></tr>
-				<tr><td colspan="2">&nbsp;</td></tr>
-			</table>
-		</td>
-	</tr>
+        </td>
+        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
+        </tr>
+</tbody>
 </table>
-</td>
-</tr>
-</table>
-        {include file='SettingsSubMenu.tpl'}
+<br>

Modified: vtigercrm/trunk/Smarty/templates/CustomFieldMapping.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CustomFieldMapping.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CustomFieldMapping.tpl Fri Jun 23 04:02:27 2006
@@ -9,100 +9,119 @@
 *
  ********************************************************************************/ *}
 <script language="JavaScript" type="text/javascript" src="include/js/customview.js"></script>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-	<tr>
-		{include file='SettingsMenu.tpl'}
-		<td width="75%" valign="top">
-		<table width="99%" border="0" cellpadding="0" cellspacing="0" align="center">
-			<tr>
-				<td class="showPanelBg" valign="top" style="padding-left:20px; "><br />
-				<span class="lvtHeaderText">{$MOD.LBL_SETTINGS} &gt; {$MOD.LBL_STUDIO} &gt; {$MOD.LBL_CUSTOM_FIELD_SETTINGS} </span>
-				<hr noshade="noshade" size="1" />
-				</td>
-			</tr>
-			<tr><td>&nbsp;</td></tr>
-			<tr>
-				</td>
+<br>
+<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
+<tbody><tr>
+        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
+        <td class="showPanelBg" style="padding: 10px;" valign="top" width="100%">
+        <br>
+
+		<div align=center>
+			{include file='SetMenu.tpl'}
+			<!-- DISPLAY -->
+				<table class="settingsSelUITopLine" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+					<td rowspan="2" valign="top" width="50"><img src="{$IMAGE_PATH}custom.gif" alt="Users" title="Users" border="0" height="48" width="48"></td>
+					<td class="heading2" valign="bottom"><b>{$MOD.LBL_SETTINGS} &gt; {$MOD.LBL_STUDIO} &gt; {$MOD.LBL_CUSTOM_FIELD_SETTINGS}</b></td>
+				</tr>
+
+				<tr>
+					<td class="small" valign="top">{$MOD.LBL_CREATE_AND_MANAGE_USER_DEFINED_FIELDS}</td>
+				</tr>
+				</table>
+				
+				<br>
 				<form action="index.php?module=Settings&action=SaveConvertLead" method="post" name="index">
-				<table class="leadTable" align="center" cellpadding="5" cellspacing="0" width="95%">
-					<tr>
-						<td style="border-bottom: 2px dotted rgb(204, 204, 204); padding: 5px;" width="5%">
-						<img src="{$IMAGE_PATH}mapping.gif" align="middle" height="48" width="48">
-						</td>
-						<td style="border-bottom: 2px dotted rgb(170, 170, 170); padding: 5px;">
-						<span class="genHeaderGrayBig">{$MOD.LBL_LEAD_MAP_CUSTOM_FIELD}</span><br>
-						<span>{$MOD.leadCustomFieldDescription}</span>
-						</td>
-					</tr>
-					<tr><td colspan="2">&nbsp;</td></tr>
-					<tr>
-						<td align="right">&nbsp;</td>
-						<td><b class="lvtHeaderText">{$MOD.LBL_MAPPING_INFO}</b></td>
-					</tr>
-					<tr>
-						<td>&nbsp;</td>
-						<td>
-							<table style="background-color: rgb(204, 204, 204);" class="small" border="0" cellpadding="5" cellspacing="1" width="95%">
-								<tr>
-									<td class="lvtCol" width="25%">{$MOD.LBL_LEAD_FIELD}</td>
-									<td class="lvtCol" width="25%">{$MOD.LBL_ACCOUNT_FIELD}</td>
-									<td class="lvtCol" width="25%">{$MOD.LBL_CONTACT_FIELD}</td>
-									<td class="lvtCol" width="25%">{$MOD.LBL_POTENTIAL_FIELD}</td>	
-								<tr>
-								{foreach key=leadcf item=cfarray from=$CUSTOMFIELDMAPPING}
-									<tr class="lvtColData" bgcolor="white">
-									<td bgcolor="#e1e1e1">{$leadcf}</td>
-									{foreach item=acc_cf key=fldnameacc from=$cfarray.account}
-										<td>
-										<select name='{$fldnameacc}'>
-										<option value='None'>{$APP.LBL_NONE}</option>
-										{foreach item=element from=$acc_cf}
-										<option value="{$element.fieldid}" {$element.selected}>{$element.fieldlabel}</option>
-										{/foreach}
-										</td>
-										</select>
-									{/foreach}
-									{foreach item=con_cf key=fldnamecon from=$cfarray.contact}
-                                                                                <td>
-                                                                                <select name='{$fldnamecon}'>
-										<option value='None'>{$APP.LBL_NONE}</option>
-										{foreach item=element from=$con_cf}
-										<option value="{$element.fieldid}" {$element.selected}>{$element.fieldlabel}</option>
-										{/foreach}
-										</td>
-                                                                                </select>                                                                                             {/foreach}
-									{foreach item=pot_cf key=fldnamepot from=$cfarray.potential}
-										<td>
-										<select name='{$fldnamepot}'>
-										<option value='None'>{$APP.LBL_NONE}</option>
-										{foreach item=element from=$pot_cf}
-										<option value="{$element.fieldid}" {$element.selected}>{$element.fieldlabel}</option>
-										{/foreach}
-										</td>
-                                                                                </select>                                                                                             {/foreach}
-									</tr>
-								{/foreach}
-							</table>
-						</td>
-					</tr>
-					<tr>
-						<td colspan="2" style="border-bottom: 2px dotted rgb(170, 170, 170); padding: 5px;">&nbsp;</td>
-					</tr>
-					<tr>
-						<td colspan="2" style="border-bottom: 2px dotted rgb(170, 170, 170); padding: 5px;" align="center">
-							<input title="{$APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" name="save" value=" &nbsp;{$APP.LBL_SAVE_BUTTON_LABEL}&nbsp; " class="classBtn" type="submit" onclick ="return validateCustomFieldAccounts();">&nbsp;
-							<input title="{$APP.LBL_CANCEL_BUTTON_LABEL}>" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" name="cancel" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick = "gotourl('index.php?action=CustomFieldList&module=Settings&fld_module=Leads&parenttab=Settings')"  class="classBtn" type="button">
-					  	</td>
-					</tr>
-					<tr>
-						<td colspan="2">&nbsp;</td>
-					</tr>
+				<table class="tableHeading" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+					<td class="big"><strong>{$MOD.LBL_EDIT_FIELD_MAPPING}</strong> </td>
+					<td class="small" align="right">&nbsp;
+					</td>
+				</tr>
+				</table>
+
+				<table class="listTableTopButtons" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+					<td class="small">&nbsp;</td>
+					<td class="small" align="right">&nbsp;&nbsp;
+					<input title="{$APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" name="save" value=" &nbsp;{$APP.LBL_SAVE_BUTTON_LABEL}&nbsp; " class="crmButton small save" type="submit" onclick ="return validateCustomFieldAccounts();">&nbsp;
+                     <input title="{$APP.LBL_CANCEL_BUTTON_LABEL}>" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" name="cancel" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick = "gotourl('index.php?action=CustomFieldList&module=Settings&fld_module=Leads&parenttab=Settings')"  class="crmButton small cancel" type="button">
+				</tr>
+				</table>
+				<table class="listTable" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+					<td rowspan="2" class="colHeader small" width="2%">#</td>
+					<td rowspan="2" class="colHeader small" width="15%">Field Label</td>
+					<td rowspan="2" class="colHeader small" width="15%">Field Type </td>
+					<td colspan="3" class="colHeader small" valign="top"><div align="center">{$MOD.LBL_MAPPING_OTHER_MODULES}</div></td>
+				</tr>
+				<tr>
+					<td class="colHeader small" valign="top" width="23%">{$APP.Accounts}</td>
+					<td class="colHeader small" valign="top" width="23%">{$APP.Contacts}</td>
+					<td class="colHeader small" valign="top" width="24%">{$APP.Potentials}</td>
+				</tr>
+				{foreach key=leadcf item=cfarray from=$CUSTOMFIELDMAPPING}
+				<tr>
+					<td class="listTableRow small">{$cfarray.sno}</td>
+					<td class="listTableRow small">{$cfarray.leadid}</td>
+					<td class="listTableRow small">{$cfarray.fieldtype}</td>
+					{foreach item=acc_cf key=fldnameacc from=$cfarray.account}
+					<td class="listTableRow small">
+						<select name='{$fldnameacc}'>
+						<option value='None'>{$APP.LBL_NONE}</option>
+						{foreach item=element from=$acc_cf}
+							<option value="{$element.fieldid}" {$element.selected}>{$element.fieldlabel}</option>
+						{/foreach}
+						</select>
+					</td>
+					{/foreach}
+					{foreach item=con_cf key=fldnamecon from=$cfarray.contact}
+                    <td class="listTableRow small">
+                        <select name='{$fldnamecon}'>
+						<option value='None'>{$APP.LBL_NONE}</option>
+						{foreach item=element from=$con_cf}
+							<option value="{$element.fieldid}" {$element.selected}>{$element.fieldlabel}</option>
+						{/foreach}
+                        </select>
+					</td>
+				  	{/foreach}
+					{foreach item=pot_cf key=fldnamepot from=$cfarray.potential}
+					<td class="listTableRow small">
+						<select name='{$fldnamepot}'>
+						<option value='None'>{$APP.LBL_NONE}</option>
+						{foreach item=element from=$pot_cf}
+							<option value="{$element.fieldid}" {$element.selected}>{$element.fieldlabel}</option>
+						{/foreach}
+                        </select>
+					</td>
+				    {/foreach}
+				</tr>
+				{/foreach}
+				</table>
+				<table border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+					<td class="small">
+		        	<strong>{$APP.LBL_NOTE}: </strong> {$MOD.LBL_CUSTOM_MAPP_INFO}
+					</td>
+				</tr>
+				</table>
+				<table border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tr>
+		  			<td class="small" align="right" nowrap="nowrap"><a href="#top">[Scroll to Top]</a></td>
+				</tr>
 				</table>
 				</form>
-			</td>
+				<br>
+		</td>
 		</tr>
-	</td>
-</tr></table>
-{include file='SettingsSubMenu.tpl'}			
-</td></tr></table>
-			
+		</table>
+        </td>
+        </tr>
+        </table>
+        </div>
+
+        </td>
+        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
+        </tr>
+</tbody>
+</table>

Modified: vtigercrm/trunk/Smarty/templates/SetMenu.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/SetMenu.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/SetMenu.tpl Fri Jun 23 04:02:27 2006
@@ -56,7 +56,11 @@
 				{/if}
 	
 				<tr><td class="settingsTabHeader" nowrap>{$MOD.LBL_STUDIO}</td></tr>
-				<tr><td class="settingsTabList" nowrap><a href="index.php?module=Settings&action=SettingsSubMenu&type=CustomField&parenttab=Settings">{$MOD.LBL_CUSTOM_FIELDS}</a></td></tr>
+				{if  $smarty.request.action eq 'CustomFieldList' || $smarty.request.action eq 'LeadCustomFieldMapping'}
+				<tr><td class="settingsTabSelected" nowrap>{$MOD.LBL_CUSTOM_FIELDS}</td></tr>
+				{else}
+				<tr><td class="settingsTabList" nowrap><a href="index.php?module=Settings&action=CustomFieldList&parenttab=Settings">{$MOD.LBL_CUSTOM_FIELDS}</a></td></tr>
+				{/if}
 				
 				{if  $smarty.request.action eq 'PickList' ||  $smarty.request.action eq 'SettingsAjax'}
 				<tr><td class="settingsTabSelected" nowrap>{$MOD.LBL_PICKLIST_EDITOR}</td></tr>						     {else}
@@ -65,7 +69,7 @@
 	
 				<tr><td class="settingsTabHeader" nowrap>{$MOD.LBL_COMMUNICATION_TEMPLATES}</td></tr>
 
-				{if $smarty.request.action eq 'listemailtemplates' || $smarty.request.action eq 'detailviewemailtemplate' || $smarty.request.action eq 'editemailtemplate' || $smarty.request.action eq 'saveemailtemplate' || $smarty.request.action eq 'deleteemailtemplate'}
+				{if $smarty.request.action eq 'listemailtemplates' || $smarty.request.action eq 'detailviewemailtemplate' || $smarty.request.action eq 'editemailtemplate' || $smarty.request.action eq 'saveemailtemplate' || $smarty.request.action eq 'deleteemailtemplate' || $smarty.request.action eq 'createemailtemplate'}
 				<tr><td class="settingsTabSelected" nowrap>{$MOD.EMAILTEMPLATES}</td></tr>
 				{else}
 				<tr><td class="settingsTabList" nowrap><a href="index.php?module=Users&action=listemailtemplates&parenttab=Settings">{$MOD.EMAILTEMPLATES}</a></td></tr>

Modified: vtigercrm/trunk/Smarty/templates/Settings.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Settings.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Settings.tpl Fri Jun 23 04:02:27 2006
@@ -182,8 +182,8 @@
 					<!-- icon 9-->
 						<table border=0 cellspacing=0 cellpadding=5 width=100%>
 						<tr>
-							<td rowspan=2 valign=top><a href="index.php?module=Settings&action=SettingsSubMenu&type=CustomField&parenttab=Settings"><img border=0 src="{$IMAGE_PATH}custom.gif" alt="{$MOD.LBL_CUSTOM_FIELDS}" title="{$MOD.LBL_CUSTOM_FIELDS}"></a></td>
-							<td class=big valign=top><a href="index.php?module=Settings&action=SettingsSubMenu&type=CustomField&parenttab=Settings">{$MOD.LBL_CUSTOM_FIELDS}</a></td>
+							<td rowspan=2 valign=top><a href="index.php?module=Settings&action=CustomFieldList&parenttab=Settings"><img border=0 src="{$IMAGE_PATH}custom.gif" alt="{$MOD.LBL_CUSTOM_FIELDS}" title="{$MOD.LBL_CUSTOM_FIELDS}"></a></td>
+							<td class=big valign=top><a href="index.php?module=Settings&action=CustomFieldList&parenttab=Settings">{$MOD.LBL_CUSTOM_FIELDS}</a></td>
 						</tr>
 						<tr>
 

Modified: vtigercrm/trunk/modules/Settings/CustomFieldList.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/CustomFieldList.php (original)
+++ vtigercrm/trunk/modules/Settings/CustomFieldList.php Fri Jun 23 04:02:27 2006
@@ -9,15 +9,14 @@
 *
  ********************************************************************************/
 require_once('Smarty_setup.php');
-require_once('modules/Settings/SettingsSubMenu.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/CustomFieldUtil.php');
+
 global $mod_strings;
+global $app_strings;
 $smarty=new vtigerCRM_Smarty;
-$fld_module = $_REQUEST['fld_module'];
-$smarty->assign("MODULE",$fld_module);
-$smarty->assign("CFENTRIES",getCFListEntries($fld_module));
 $smarty->assign("MOD",$mod_strings);
+$smarty->assign("APP",$app_strings);
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
@@ -35,9 +34,45 @@
                         'SalesOrder'=>'SalesOrder',
                         'Quotes'=>'Quotes',
                         'Invoice'=>'Invoice',
-			'Campaigns'=>'Campaigns'
+						'Campaigns'=>'Campaigns'
                         );
+$cfimagecombo = Array($image_path."text.gif",
+$image_path."number.gif",
+$image_path."percent.gif",
+$image_path."currency.gif",
+$image_path."date.gif",
+$image_path."email.gif",
+$image_path."phone.gif",
+$image_path."picklist.gif",
+$image_path."url.gif",
+$image_path."checkbox.gif",
+$image_path."text.gif",
+$image_path."picklist.gif");
+
+$cftextcombo = Array($mod_strings['Text'],
+$mod_strings['Number'],
+$mod_strings['Percent'],
+$mod_strings['Currency'],
+$mod_strings['Date'],
+$mod_strings['Email'],
+$mod_strings['Phone'],
+$mod_strings['PickList'],
+$mod_strings['LBL_URL'],
+$mod_strings['LBL_CHECK_BOX'],
+$mod_strings['LBL_TEXT_AREA'],
+$mod_strings['LBL_MULTISELECT_COMBO']
+);
+
+
 $smarty->assign("MODULES",$module_array);
+$smarty->assign("CFTEXTCOMBO",$cftextcombo);
+$smarty->assign("CFIMAGECOMBO",$cfimagecombo);
+if($_REQUEST['fld_module'] !='')
+	$fld_module = $_REQUEST['fld_module'];
+else
+	$fld_module = 'Leads';
+$smarty->assign("MODULE",$fld_module);
+$smarty->assign("CFENTRIES",getCFListEntries($fld_module));
 if(isset($_REQUEST["duplicate"]) && $_REQUEST["duplicate"] == "yes")
 {
 	$error='Custom Field in the Name '.$_REQUEST["fldlabel"].' already exists. Please specify a different Label';
@@ -48,4 +83,71 @@
 else
 	$smarty->display('CustomFieldEntries.tpl');
 
+function getCFListEntries($module)
+{
+	$tabid = getTabid($module);
+	global $adb;
+	global $theme;
+	$theme_path="themes/".$theme."/";
+	$image_path=$theme_path."images/";
+	$dbQuery = "select fieldid,columnname,fieldlabel,uitype,displaytype,vtiger_convertleadmapping.cfmid from vtiger_field left join vtiger_convertleadmapping on  vtiger_convertleadmapping.leadfid = vtiger_field.fieldid where tabid=".$tabid." and generatedtype=2 order by sequence";
+	$result = $adb->query($dbQuery);
+	$row = $adb->fetch_array($result);
+	$count=1;
+	$cflist=Array();
+	if($row!='')
+	{
+		do
+		{
+			$cf_element=Array();
+			$cf_element['no']=$count;
+			$cf_element['label']=$row["fieldlabel"];
+			$fld_type_name = getCustomFieldTypeName($row["uitype"]);
+			$cf_element['type']=$fld_type_name;
+			if($module == 'Leads')
+			{
+				$mapping_details = getListLeadMapping($row["cfmid"]);
+				$cf_element[]= $mapping_details['accountlabel'];
+				$cf_element[]= $mapping_details['contactlabel'];
+				$cf_element[]= $mapping_details['potentiallabel'];
+			}
+			$cf_element['tool']='<img src="'.$image_path.'editfield.gif" border="0" onClick="getCreateCustomFieldForm(\''.$module.'\',\''.$row["fieldid"].'\',\''.$tabid.'\',\''.$row["uitype"].'\')" alt="Edit" title="Edit"/>&nbsp;|&nbsp;<a href="javascript:deleteCustomField('.$row["fieldid"].',\''.$module.'\', \''.$row["columnname"].'\', \''.$row["uitype"].'\')"><img src="'.$image_path.'delete.gif" border="0"  alt="Delete" title="Delete"/></a>';
+
+			$cflist[] = $cf_element;
+			$count++;
+		}while($row = $adb->fetch_array($result));
+	}
+	return $cflist;
+}
+function getListLeadMapping($cfid)
+{
+	global $adb;
+	$sql="select * from vtiger_convertleadmapping where cfmid =".$cfid;
+	$result = $adb->query($sql);
+	$noofrows = $adb->num_rows($result);
+	for($i =0;$i <$noofrows;$i++)
+	{
+		$leadid = $adb->query_result($result,$i,'leadfid');
+		$accountid = $adb->query_result($result,$i,'accountfid');
+		$contactid = $adb->query_result($result,$i,'contactfid');
+		$potentialid = $adb->query_result($result,$i,'potentialfid');
+		$cfmid = $adb->query_result($result,$i,'cfmid');
+
+		$sql2="select fieldlabel from vtiger_field where fieldid ='".$accountid."'";
+		$result2 = $adb->query($sql2);
+		$accountfield = $adb->query_result($result2,0,'fieldlabel');
+		$label['accountlabel'] = $accountfield;
+		
+		$sql3="select fieldlabel from vtiger_field where fieldid ='".$contactid."'";
+		$result3 = $adb->query($sql3);
+		$contactfield = $adb->query_result($result3,0,'fieldlabel');
+		$label['contactlabel'] = $contactfield;
+		$sql4="select fieldlabel from vtiger_field where fieldid ='".$potentialid."'";
+		$result4 = $adb->query($sql4);
+		$potentialfield = $adb->query_result($result4,0,'fieldlabel');
+		$label['potentiallabel'] = $potentialfield;
+	}
+	return $label;
+}
+
 ?>

Modified: vtigercrm/trunk/modules/Settings/LeadCustomFieldMapping.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/LeadCustomFieldMapping.php (original)
+++ vtigercrm/trunk/modules/Settings/LeadCustomFieldMapping.php Fri Jun 23 04:02:27 2006
@@ -8,24 +8,18 @@
 * All Rights Reserved.
 *
 ********************************************************************************/
-
-require_once('Smarty_setup.php');	
+require_once('Smarty_setup.php');
+require_once('include/database/PearDatabase.php');
+require_once('include/CustomFieldUtil.php');
 global $mod_strings;
 global $app_strings;
-global $app_list_strings;
-global $adb;
+
+$smarty=new vtigerCRM_Smarty;
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
-
-$smarty=new vtigerCRM_Smarty;
-$smarty->assign("MOD", $mod_strings);
-$smarty->assign("APP", $app_strings);
 $smarty->assign("IMAGE_PATH", $image_path);
-
-$smarty->assign("RETURN_MODULE","Settings");
-$smarty->assign("RETURN_ACTION","");
 
 function getAccountCustomValues($leadid,$accountid)
 {
@@ -93,34 +87,36 @@
 	$potentialcf[$leadid.'_potential']=$potential_cfelement;
         return $potentialcf;
 }
-$lead_sql="select fieldid,fieldlabel from vtiger_field,vtiger_tab where vtiger_field.tabid=vtiger_tab.tabid and generatedtype=2 and vtiger_tab.name='Leads'";
-$result = $adb->query($lead_sql);
-$noofrows = $adb->num_rows($result);
 
-$display_val="<table border=0 cellspacing=1 cellpadding=2 width=75%>";
-$leadcf=Array();
-for($i=0; $i<$noofrows; $i++)
+function customFieldMappings()
 {
-	$lead_field['fieldid']=$adb->query_result($result,$i,"fieldid");
-	$lead_field['fieldlabel']=$adb->query_result($result,$i,"fieldlabel");
-	$convert_sql="select * from vtiger_convertleadmapping where leadfid=".$lead_field['fieldid'];
+	global $adb;
+
+	$convert_sql="select vtiger_convertleadmapping.*,uitype,fieldlabel from vtiger_convertleadmapping left join vtiger_field on vtiger_field.fieldid = vtiger_convertleadmapping.leadfid";
 	$convert_result = $adb->query($convert_sql);
 
 	$no_rows = $adb->num_rows($convert_result);
 	for($j=0; $j<$no_rows; $j++)
 	{
+		$leadid = $adb->query_result($convert_result,$j,"leadfid");
 		$accountid=$adb->query_result($convert_result,$j,"accountfid");
 		$contactid=$adb->query_result($convert_result,$j,"contactfid");
 		$potentialid=$adb->query_result($convert_result,$j,"potentialfid");
-	
-		
+		$lead_field['sno'] = $j+1;
+		$lead_field['leadid'] = $adb->query_result($convert_result,$j,"fieldlabel"); 
+		$lead_field['fieldtype'] = getCustomFieldTypeName($adb->query_result($convert_result,$j,"uitype"));; 
+		$lead_field['account'] = getAccountCustomValues($leadid,$accountid);
+		$lead_field['contact'] = getContactCustomValues($leadid,$contactid);
+		$lead_field['potential'] = getPotentialCustomValues($leadid,$potentialid);
+		$leadcf[]= $lead_field;
 	}
-	$lead_field['account']=getAccountCustomValues($lead_field['fieldid'],$accountid);
-	$lead_field['contact']=getContactCustomValues($lead_field['fieldid'],$contactid);
-	$lead_field['potential']=getPotentialCustomValues($lead_field['fieldid'],$potentialid);
-	$leadcf[$lead_field['fieldlabel']]= $lead_field;
+
+	return $leadcf;
 }
-$smarty->assign("CUSTOMFIELDMAPPING",$leadcf);
+
+$smarty->assign("MOD",$mod_strings);
+$smarty->assign("APP",$app_strings);
+$smarty->assign("CUSTOMFIELDMAPPING",customFieldMappings());
 
 $smarty->display("CustomFieldMapping.tpl");
 

Modified: vtigercrm/trunk/modules/Settings/SaveConvertLead.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/SaveConvertLead.php (original)
+++ vtigercrm/trunk/modules/Settings/SaveConvertLead.php Fri Jun 23 04:02:27 2006
@@ -13,10 +13,8 @@
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
 
-//echo"<h3> In Save</h3>";
 	
 	$sql="select fieldid from vtiger_field, vtiger_tab where vtiger_field.tabid=vtiger_tab.tabid and generatedtype=2 and vtiger_tab.name='Leads';";	
-//	echo $sql;	
 	$result = $adb->query($sql);
 	$noofrows = $adb->num_rows($result);
 	
@@ -47,6 +45,6 @@
 
 		$adb->query($update_sql);
 	}
-	 header("Location: index.php?action=ListLeadCustomFieldMapping&module=Settings&parenttab=Settings");
+	 header("Location: index.php?action=CustomFieldList&module=Settings&parenttab=Settings");
 	
 ?>





More information about the vtigercrm-commits mailing list