[Vtigercrm-commits] [vtiger-commits] r9995 - in /vtigercrm/branches/5.0.3: Smarty/templates/CreateView.tpl Smarty/templates/QuickCreate.tpl include/js/general.js modules/Accounts/Save.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Dec 21 11:53:40 EST 2006
Author: richie
Date: Thu Dec 21 09:53:31 2006
New Revision: 9995
Log:
Changes made to avoid creating duplicate account
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl
vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl
vtigercrm/branches/5.0.3/include/js/general.js
vtigercrm/branches/5.0.3/modules/Accounts/Save.php
Modified: vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl Thu Dec 21 09:53:31 2006
@@ -1,280 +1,284 @@
-{*<!--
-
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is: vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-
--->*}
-
-{*<!-- module header -->*}
-
-<link rel="stylesheet" type="text/css" media="all" href="jscalendar/calendar-win2k-cold-1.css">
-<script type="text/javascript" src="jscalendar/calendar.js"></script>
-<script type="text/javascript" src="jscalendar/lang/calendar-{$CALENDAR_LANG}.js"></script>
-<script type="text/javascript" src="jscalendar/calendar-setup.js"></script>
-<script type="text/javascript" src="modules/{$MODULE}/{$SINGLE_MOD}.js"></script>
-
-<script type="text/javascript">
-function sensex_info()
-{ldelim}
- var Ticker = $('tickersymbol').value;
- if(Ticker!='')
- {ldelim}
- $("vtbusy_info").style.display="inline";
- new Ajax.Request(
- 'index.php',
- {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
- method: 'post',
- postBody: 'module={$MODULE}&action=Tickerdetail&tickersymbol='+Ticker,
- onComplete: function(response) {ldelim}
- $('autocom').innerHTML = response.responseText;
- $('autocom').style.display="block";
- $("vtbusy_info").style.display="none";
- {rdelim}
- {rdelim}
- );
- {rdelim}
-{rdelim}
-</script>
-
- {include file='Buttons_List1.tpl'}
-
-{*<!-- Contents -->*}
-<table border=0 cellspacing=0 cellpadding=0 width=98% align=center>
- <tr>
- <td valign=top>
- <img src="{$IMAGE_PATH}showPanelTopLeft.gif">
- </td>
-
- <td class="showPanelBg" valign=top width=100%>
- {*<!-- PUBLIC CONTENTS STARTS-->*}
- <div class="small" style="padding:20px">
-
- {if $OP_MODE eq 'edit_view'}
- <span class="lvtHeaderText"><font color="purple">[ {$ID} ] </font>{$NAME} - {$APP.LBL_EDITING} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}</span> <br>
- {$UPDATEINFO}
- {/if}
- {if $OP_MODE eq 'create_view'}
- {if $DUPLICATE neq 'true'}
- <span class="lvtHeaderText">{$APP.LBL_CREATING} {$APP.LBL_NEW} {$APP[$SINGLE_MOD]}</span> <br>
- {else}
- <span class="lvtHeaderText">{$APP.LBL_DUPLICATING} "{$NAME}" </span> <br>
- {/if}
- {/if}
-
- <hr noshade size=1>
- <br>
-
- {include file='EditViewHidden.tpl'}
-
- {*<!-- Account details tabs -->*}
- <table border=0 cellspacing=0 cellpadding=0 width=95% align=center>
- <tr>
- <td>
- <table border=0 cellspacing=0 cellpadding=3 width=100% class="small">
- <tr>
- <td class="dvtTabCache" style="width:10px" nowrap> </td>
-
- {if $ADVBLOCKS neq ''}
- <td width=75 style="width:15%" align="center" nowrap class="dvtSelectedCell" id="bi" onclick="fnLoadValues('bi','mi','basicTab','moreTab','normal','{$MODULE}')"><b>{$APP.LBL_BASIC} {$APP.LBL_INFORMATION}</b></td>
- <td class="dvtUnSelectedCell" style="width: 100px;" align="center" nowrap id="mi" onclick="fnLoadValues('mi','bi','moreTab','basicTab','normal','{$MODULE}')"><b>{$APP.LBL_MORE} {$APP.LBL_INFORMATION} </b></td>
- <td class="dvtTabCache" style="width:65%" nowrap> </td>
- {else}
- <td class="dvtSelectedCell" align=center nowrap>{$APP.LBL_BASIC} {$APP.LBL_INFORMATION}</td>
- <td class="dvtTabCache" style="width:65%"> </td>
- {/if}
- <tr>
- </table>
- </td>
- </tr>
- <tr>
- <td valign=top align=left >
-
- <!-- Basic Information Tab Opened -->
- <div id="basicTab">
-
- <table border=0 cellspacing=0 cellpadding=3 width=100% class="dvtContentSpace">
- <tr>
- <td align=left>
- <!-- content cache -->
-
- <table border=0 cellspacing=0 cellpadding=0 width=100%>
- <tr>
- <td id ="autocom"></td>
- </tr>
- <tr>
- <td style="padding:10px">
- <!-- General details -->
- <table border=0 cellspacing=0 cellpadding=0 width=100% class="small">
- <tr>
- <td colspan=4 style="padding:5px">
- <div align="center">
- <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" 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="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
- </div>
- </td>
- </tr>
-
- {foreach key=header item=data from=$BASBLOCKS}
- <tr>
- {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
- <td colspan=2 class="detailedViewHeader">
- <b>{$header}</b></td>
- <td class="detailedViewHeader">
- <input name="cpy" onclick="return copyAddressLeft(EditView)" type="radio"><b>{$APP.LBL_RCPY_ADDRESS}</b></td>
- <td class="detailedViewHeader">
- <input name="cpy" onclick="return copyAddressRight(EditView)" type="radio"><b>{$APP.LBL_LCPY_ADDRESS}</b></td>
-
- {elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'}
- <td colspan=2 class="detailedViewHeader">
- <b>{$header}</b></td>
- <td class="detailedViewHeader">
- <input name="cpy" onclick="return copyAddressLeft(EditView)" type="radio"><b>{$APP.LBL_CPY_OTHER_ADDRESS}</b></td>
- <td class="detailedViewHeader">
- <input name="cpy" onclick="return copyAddressRight(EditView)" type="radio"><b>{$APP.LBL_CPY_MAILING_ADDRESS}</b></td>
- {else}
- <td colspan=4 class="detailedViewHeader">
- <b>{$header}</b>
- {/if}
- </td>
- </tr>
-
- <!-- Here we should include the uitype handlings-->
- {include file="DisplayFields.tpl"}
- <tr style="height:25px"><td> </td></tr>
- {/foreach}
-
- <tr>
- <td colspan=4 style="padding:5px">
- <div align="center">
- {if $MODULE eq 'Emails'}
- <input title="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_KEY}" class="crmbutton small create" 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="crmbutton small save" 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="crmbutton small save" 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="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- </div>
- <!-- Basic Information Tab Closed -->
-
- <!-- More Information Tab Opened -->
- <div id="moreTab">
- <table border=0 cellspacing=0 cellpadding=3 width=100% class="dvtContentSpace">
- <tr>
- <td align=left>
- {*<!-- content cache -->*}
-
- <table border=0 cellspacing=0 cellpadding=0 width=100%>
- <tr>
- <td id ="autocom"></td>
- </tr>
- <tr>
- <td style="padding:10px">
- <!-- General details -->
- <table border=0 cellspacing=0 cellpadding=0 width=100% class="small">
- <tr>
- <td colspan=4 style="padding:5px">
- <div align="center">
- <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" 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="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
- </div>
- </td>
- </tr>
-
- {foreach key=header item=data from=$ADVBLOCKS}
- <tr>
- <td colspan=4 class="detailedViewHeader">
- <b>{$header}</b>
- </td>
- </tr>
-
- <!-- Here we should include the uitype handlings-->
- {include file="DisplayFields.tpl"}
-
- <tr style="height:25px"><td> </td></tr>
- {/foreach}
-
- <tr>
- <td colspan=4 style="padding:5px">
- <div align="center">
- {if $MODULE eq 'Emails'}
- <input title="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_KEY}" class="crmbutton small create" 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="crmbutton small save" 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="crmbutton small save" 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="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
-
- </td>
- </tr>
- </table>
- </div>
- </td>
- <td align=right valign=top><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
- </tr>
-</table>
-</form>
-
-{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 'Notes'}
- oFCKeditor = new FCKeditor( "notecontent" ) ;
- {/if}
-
- oFCKeditor.BasePath = "include/fckeditor/" ;
- oFCKeditor.ReplaceTextarea() ;
-
- </script>
-{/if}
-{if $MODULE eq 'Accounts'}
-<script>
- ScrollEffect.limit = 201;
- ScrollEffect.closelimit= 200;
-</script>
-{/if}
-<script>
-
-
-
- var fieldname = new Array({$VALIDATION_DATA_FIELDNAME})
-
- var fieldlabel = new Array({$VALIDATION_DATA_FIELDLABEL})
-
- var fielddatatype = new Array({$VALIDATION_DATA_FIELDDATATYPE})
-
-
-</script>
-
-
-
+{*<!--
+
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is: vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
+-->*}
+
+{*<!-- module header -->*}
+
+<link rel="stylesheet" type="text/css" media="all" href="jscalendar/calendar-win2k-cold-1.css">
+<script type="text/javascript" src="jscalendar/calendar.js"></script>
+<script type="text/javascript" src="jscalendar/lang/calendar-{$CALENDAR_LANG}.js"></script>
+<script type="text/javascript" src="jscalendar/calendar-setup.js"></script>
+<script type="text/javascript" src="modules/{$MODULE}/{$SINGLE_MOD}.js"></script>
+
+<script type="text/javascript">
+function sensex_info()
+{ldelim}
+ var Ticker = $('tickersymbol').value;
+ if(Ticker!='')
+ {ldelim}
+ $("vtbusy_info").style.display="inline";
+ new Ajax.Request(
+ 'index.php',
+ {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+ method: 'post',
+ postBody: 'module={$MODULE}&action=Tickerdetail&tickersymbol='+Ticker,
+ onComplete: function(response) {ldelim}
+ $('autocom').innerHTML = response.responseText;
+ $('autocom').style.display="block";
+ $("vtbusy_info").style.display="none";
+ {rdelim}
+ {rdelim}
+ );
+ {rdelim}
+{rdelim}
+</script>
+
+ {include file='Buttons_List1.tpl'}
+
+{*<!-- Contents -->*}
+<table border=0 cellspacing=0 cellpadding=0 width=98% align=center>
+ <tr>
+ <td valign=top>
+ <img src="{$IMAGE_PATH}showPanelTopLeft.gif">
+ </td>
+
+ <td class="showPanelBg" valign=top width=100%>
+ {*<!-- PUBLIC CONTENTS STARTS-->*}
+ <div class="small" style="padding:20px">
+
+ {if $OP_MODE eq 'edit_view'}
+ <span class="lvtHeaderText"><font color="purple">[ {$ID} ] </font>{$NAME} - {$APP.LBL_EDITING} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}</span> <br>
+ {$UPDATEINFO}
+ {/if}
+ {if $OP_MODE eq 'create_view'}
+ {if $DUPLICATE neq 'true'}
+ <span class="lvtHeaderText">{$APP.LBL_CREATING} {$APP.LBL_NEW} {$APP[$SINGLE_MOD]}</span> <br>
+ {else}
+ <span class="lvtHeaderText">{$APP.LBL_DUPLICATING} "{$NAME}" </span> <br>
+ {/if}
+ {/if}
+
+ <hr noshade size=1>
+ <br>
+
+ {include file='EditViewHidden.tpl'}
+
+ {*<!-- Account details tabs -->*}
+ <table border=0 cellspacing=0 cellpadding=0 width=95% align=center>
+ <tr>
+ <td>
+ <table border=0 cellspacing=0 cellpadding=3 width=100% class="small">
+ <tr>
+ <td class="dvtTabCache" style="width:10px" nowrap> </td>
+
+ {if $ADVBLOCKS neq ''}
+ <td width=75 style="width:15%" align="center" nowrap class="dvtSelectedCell" id="bi" onclick="fnLoadValues('bi','mi','basicTab','moreTab','normal','{$MODULE}')"><b>{$APP.LBL_BASIC} {$APP.LBL_INFORMATION}</b></td>
+ <td class="dvtUnSelectedCell" style="width: 100px;" align="center" nowrap id="mi" onclick="fnLoadValues('mi','bi','moreTab','basicTab','normal','{$MODULE}')"><b>{$APP.LBL_MORE} {$APP.LBL_INFORMATION} </b></td>
+ <td class="dvtTabCache" style="width:65%" nowrap> </td>
+ {else}
+ <td class="dvtSelectedCell" align=center nowrap>{$APP.LBL_BASIC} {$APP.LBL_INFORMATION}</td>
+ <td class="dvtTabCache" style="width:65%"> </td>
+ {/if}
+ <tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td valign=top align=left >
+
+ <!-- Basic Information Tab Opened -->
+ <div id="basicTab">
+
+ <table border=0 cellspacing=0 cellpadding=3 width=100% class="dvtContentSpace">
+ <tr>
+ <td align=left>
+ <!-- content cache -->
+
+ <table border=0 cellspacing=0 cellpadding=0 width=100%>
+ <tr>
+ <td id ="autocom"></td>
+ </tr>
+ <tr>
+ <td style="padding:10px">
+ <!-- General details -->
+ <table border=0 cellspacing=0 cellpadding=0 width=100% class="small">
+ <tr>
+ <td colspan=4 style="padding:5px">
+ <div align="center">
+ {if $MODULE eq 'Accounts'}
+ <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" onclick="this.form.action.value='Save'; if(formValidate())AjaxDuplicateValidate('Accounts','accountname',this.form);" type="button" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " style="width:70px" >
+ {else}
+ <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" onclick="this.form.action.value='Save'; return formValidate()" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " style="width:70px" >
+ {/if}
+ <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
+ </div>
+ </td>
+ </tr>
+
+ {foreach key=header item=data from=$BASBLOCKS}
+ <tr>
+ {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
+ <td colspan=2 class="detailedViewHeader">
+ <b>{$header}</b></td>
+ <td class="detailedViewHeader">
+ <input name="cpy" onclick="return copyAddressLeft(EditView)" type="radio"><b>{$APP.LBL_RCPY_ADDRESS}</b></td>
+ <td class="detailedViewHeader">
+ <input name="cpy" onclick="return copyAddressRight(EditView)" type="radio"><b>{$APP.LBL_LCPY_ADDRESS}</b></td>
+
+ {elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'}
+ <td colspan=2 class="detailedViewHeader">
+ <b>{$header}</b></td>
+ <td class="detailedViewHeader">
+ <input name="cpy" onclick="return copyAddressLeft(EditView)" type="radio"><b>{$APP.LBL_CPY_OTHER_ADDRESS}</b></td>
+ <td class="detailedViewHeader">
+ <input name="cpy" onclick="return copyAddressRight(EditView)" type="radio"><b>{$APP.LBL_CPY_MAILING_ADDRESS}</b></td>
+ {else}
+ <td colspan=4 class="detailedViewHeader">
+ <b>{$header}</b>
+ {/if}
+ </td>
+ </tr>
+
+ <!-- Here we should include the uitype handlings-->
+ {include file="DisplayFields.tpl"}
+ <tr style="height:25px"><td> </td></tr>
+ {/foreach}
+
+ <tr>
+ <td colspan=4 style="padding:5px">
+ <div align="center">
+ {if $MODULE eq 'Emails'}
+ <input title="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_KEY}" class="crmbutton small create" 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="crmbutton small save" 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="crmbutton small save" 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="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ <!-- Basic Information Tab Closed -->
+
+ <!-- More Information Tab Opened -->
+ <div id="moreTab">
+ <table border=0 cellspacing=0 cellpadding=3 width=100% class="dvtContentSpace">
+ <tr>
+ <td align=left>
+ {*<!-- content cache -->*}
+
+ <table border=0 cellspacing=0 cellpadding=0 width=100%>
+ <tr>
+ <td id ="autocom"></td>
+ </tr>
+ <tr>
+ <td style="padding:10px">
+ <!-- General details -->
+ <table border=0 cellspacing=0 cellpadding=0 width=100% class="small">
+ <tr>
+ <td colspan=4 style="padding:5px">
+ <div align="center">
+ <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" 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="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
+ </div>
+ </td>
+ </tr>
+
+ {foreach key=header item=data from=$ADVBLOCKS}
+ <tr>
+ <td colspan=4 class="detailedViewHeader">
+ <b>{$header}</b>
+ </td>
+ </tr>
+
+ <!-- Here we should include the uitype handlings-->
+ {include file="DisplayFields.tpl"}
+
+ <tr style="height:25px"><td> </td></tr>
+ {/foreach}
+
+ <tr>
+ <td colspan=4 style="padding:5px">
+ <div align="center">
+ {if $MODULE eq 'Emails'}
+ <input title="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE}" accessKey="{$APP.LBL_SELECTEMAILTEMPLATE_BUTTON_KEY}" class="crmbutton small create" 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="crmbutton small save" onclick="this.form.action.value='Save';this.form.send_mail.value='true'; return formValidate()" type="submit" name="button" value=" {$MOD.LBL_SEND} " >
+ {/if}
+ {if $MODULE eq 'Accounts'}
+ <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" onclick="this.form.action.value='Save'; if(formValidate())AjaxDuplicateValidate('Accounts','accountname',this.form);" type="button" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " style="width:70px" >
+ {else}
+ <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" onclick="this.form.action.value='Save'; return formValidate()" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " style="width:70px" >
+ {/if}
+ <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="crmbutton small cancel" onclick="window.history.back()" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ <td align=right valign=top><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
+ </tr>
+</table>
+</form>
+
+{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 'Notes'}
+ oFCKeditor = new FCKeditor( "notecontent" ) ;
+ {/if}
+
+ oFCKeditor.BasePath = "include/fckeditor/" ;
+ oFCKeditor.ReplaceTextarea() ;
+
+ </script>
+{/if}
+{if $MODULE eq 'Accounts'}
+<script>
+ ScrollEffect.limit = 201;
+ ScrollEffect.closelimit= 200;
+</script>
+{/if}
+<script>
+
+
+
+ var fieldname = new Array({$VALIDATION_DATA_FIELDNAME})
+
+ var fieldlabel = new Array({$VALIDATION_DATA_FIELDLABEL})
+
+ var fielddatatype = new Array({$VALIDATION_DATA_FIELDDATATYPE})
+
+
+</script>
Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Thu Dec 21 09:53:31 2006
@@ -380,7 +380,14 @@
<!-- save cancel buttons -->
<table border=0 cellspacing=0 cellpadding=5 width=100% class=qcTransport>
<tr>
- <td width=50% align=right><input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " style="width:70px" ></td>
+
+ {if $MODULE eq 'Accounts'}
+ <td width=50% align=right><input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" onclick="this.form.action.value='Save';AjaxDuplicateValidate('Accounts','accountname',this.form);" type="button" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " style="width:70px" ></td>
+ {else}
+ <td width=50% align=right><input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="crmbutton small save" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL}" style="width:70px" ></td>
+ {/if}
+
+
<td width=50% align=left>
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="crmbutton small cancel" onclick="hide('qcform'); $('qccombo').options.selectedIndex=0;" type="button" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " style="width:70px">
</td>
Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Thu Dec 21 09:53:31 2006
@@ -1717,4 +1717,26 @@
inputField : fieldid, ifFormat : dateformat, showsTime : false, button : imageid, singleClick : true, step : 1
});
}
-
+function AjaxDuplicateValidate(module,fieldname,oform)
+{
+ var fieldvalue = getObj(fieldname).value;
+ var url = "module="+module+"&action="+module+"Ajax&file=Save&"+fieldname+"="+fieldvalue+"&dup_check=true"
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody:url,
+ onComplete: function(response) {
+ var str = response.responseText
+ if(str.indexOf('SUCCESS') > -1)
+ {
+ oform.submit();
+ }else
+ {
+ alert(str);
+ }
+ }
+ }
+ );
+
+}
Modified: vtigercrm/branches/5.0.3/modules/Accounts/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Accounts/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Accounts/Save.php Thu Dec 21 09:53:31 2006
@@ -26,6 +26,26 @@
//require_once('database/DatabaseConnection.php');
require_once('include/database/PearDatabase.php');
+if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check'] != '')
+{
+ //started
+ $value = $_REQUEST['accountname'];
+ $query = "SELECT accountname FROM vtiger_account WHERE accountname ='".$value."'";
+ $result = $adb->query($query);
+ if($adb->num_rows($result) > 0)
+ {
+ echo 'Account Name Already Exists!';
+ }
+ else
+ {
+ echo 'SUCCESS';
+ }
+ die;
+}
+//Ended
+
+
+
$local_log =& LoggerManager::getLogger('index');
global $log;
$focus = new Accounts();
@@ -51,9 +71,7 @@
if(isset($_REQUEST[$fieldname]))
{
$value = $_REQUEST[$fieldname];
- //echo '<BR>';
- //echo $fieldname." ".$value;
- //echo '<BR>';
+ $log->DEBUG($fieldname."=Field Name &first& Value =".$value);
$focus->column_fields[$fieldname] = $value;
}
if(isset($_REQUEST['annual_revenue']))
More information about the vtigercrm-commits
mailing list