[Vtigercrm-commits] [vtiger-commits] r6120 - /vtigercrm/trunk/Smarty/templates/GroupEditView.tpl
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed May 17 08:51:27 EDT 2006
Author: don
Date: Wed May 17 06:51:23 2006
New Revision: 6120
Log:
Duplicate handling done
Modified:
vtigercrm/trunk/Smarty/templates/GroupEditView.tpl
Modified: vtigercrm/trunk/Smarty/templates/GroupEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/GroupEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/GroupEditView.tpl Wed May 17 06:51:23 2006
@@ -12,6 +12,28 @@
<script language="JavaScript" type="text/javascript" src="include/js/menu.js"></script>
<style type="text/css">@import url(themes/blue/style.css);</style>
<script language="javascript">
+
+function dup_validation()
+{ldelim}
+ //show("status");
+ var ajaxObj = new Ajax(ajaxSaveResponse);
+ var groupname = document.getElementById('groupName').value;
+ var mode = getObj('mode').value;
+ var groupid = getObj('groupId').value;
+ if(mode == 'edit')
+ var urlstring ="module=Users&action=UsersAjax&file=SaveGroup&ajax=true&dup_check=true&mode="+mode+"&groupName="+groupname+"&groupid="+groupid;
+ else
+ var urlstring ="module=Users&action=UsersAjax&file=SaveGroup&ajax=true&dup_check=true&groupName="+groupname;
+ ajaxObj.process("index.php?",urlstring);
+{rdelim}
+function ajaxSaveResponse(response)
+{ldelim}
+ if(response.responseText == 'SUCESS')
+ document.newGroupForm.submit();
+ else
+ alert(response.responseText);
+{rdelim}
+
var constructedOptionValue;
var constructedOptionName;
@@ -117,7 +139,7 @@
alert('Group should have atleast one member. Select a member to the group');
return false;
{rdelim}
- return true;
+ dup_validation();
{rdelim}
</script>
@@ -168,7 +190,7 @@
<td style="padding-right: 10px;" align="right" width="20%">
<b>{$CMOD.LBL_GROUP_NAME} {$CMOD.LBL_COLON}</b></td>
<td style="padding-left: 10px;" align="left" width="80%">
- <input name="groupName" class="importBox" style="width:40%;" type="text" value="{$GROUPNAME}">
+ <input id="groupName" name="groupName" class="importBox" style="width:40%;" type="text" value="{$GROUPNAME}">
</td>
</tr>
<tr><td colspan="3"> </td></tr>
@@ -228,9 +250,9 @@
<tr>
<td colspan="3" align="center">
{if $MODE eq 'edit'}
- <input type="submit" class="classBtn" name="add" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " onClick="return validate()">
+ <input type="button" class="classBtn" name="add" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " onClick="return validate()">
{else}
- <input type="submit" class="classBtn" name="add" value="{$CMOD.LBL_ADD_GROUP_BUTTON}" onClick="return validate()">
+ <input type="button" class="classBtn" name="add" value="{$CMOD.LBL_ADD_GROUP_BUTTON}" onClick="return validate()">
{/if}
<input type="button" class="classBtn" name="cancel" value="{$APP.LBL_CANCEL_BUTTON_LABEL}" onClick="window.history.back()">
More information about the vtigercrm-commits
mailing list