BUG 5357 The Trigger Wizard doesn't check whether the user... SOLVED

- No validation is performed.
- Was add validation in the Trigger Wizard.
This commit is contained in:
Marco Antonio Nina
2012-09-28 12:07:28 -04:00
parent e31c8d2651
commit d2ac677428
8 changed files with 84 additions and 57 deletions

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="triggersProperties" type="xmlform" width="100%" labelWidth="20%" enableTemplate="1">
<PRO_UID type="hidden"/>
<FIELDS_REQUIRED type="hidden"/>
<TITLE type="title" group="1">

View File

@@ -7,6 +7,7 @@
<td valign="top">
<input class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="" type="hidden">
<input name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" type="hidden">
<input name="FIELDS_REQUIRED" id="FIELDS_REQUIRED" value="{$FIELDS_REQUIRED}" type="hidden">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr style="display: none;">
<td colspan="2">{$form.TRI_UID}{$form.PRO_UID}</td>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="triggersProperties" type="xmlform" width="100%" labelWidth="20%" enableTemplate="1">
<PRO_UID type="hidden"/>
<FIELDS_REQUIRED type="hidden"/>
<TITLE type="title" group="1">
<en>Trigger Information</en>
</TITLE>

View File

@@ -9,6 +9,7 @@
<PRO_UID type="private"/>
<FIELDS_REQUIRED type="private"/>
<triggersEdit type="private" defaultValue="../triggers/triggers_Edit"/>
@@ -90,27 +91,38 @@
function triggerSave(form)
{
var triUid = "";
if(document.getElementById('TRI_UID')) {
var triUid = document.getElementById('TRI_UID').value;
}
if(triUid==''){
var triTitle =document.getElementById('TRI_TITLE').value;
if(triTitle==''){
alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false;
}
reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(document.getElementById('PRO_UID').value),'POST') ;
if(!reqName){
alert(G_STRINGS.ID_EXIST_TRIGGERS);return false;
var triUid = "";
if(document.getElementById('TRI_UID')) {
var triUid = document.getElementById('TRI_UID').value;
}
var triTitle =document.getElementById('TRI_TITLE').value;
if(triTitle==''){
alert(G_STRINGS.ID_REQUIRED_NAME_TRIGGERS);return false;
}
var fieldsRequired = document.getElementById('FIELDS_REQUIRED').value;
fieldsRequired = fieldsRequired.split(",");
for (i=0; i<fieldsRequired.length; i++)
{
var field = document.getElementById(fieldsRequired[i]).value;
if (field == '') {
alert(_('ID_REQUIRED_FIELDS_ERROR'));return false;
}
}
if(triUid==''){
reqName=ajax_function("../triggers/triggers_Save",'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+(document.getElementById('PRO_UID').value),'POST') ;
if(!reqName){
alert(G_STRINGS.ID_EXIST_TRIGGERS);return false;
}else{
ajax_post(form.action, form, 'POST');
currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh();
}
}else{
ajax_post(form.action, form, 'POST');
currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh();
}
}else{
ajax_post(form.action, form, 'POST');
currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh();
ajax_post(form.action, form, 'POST');
currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh();
}
}
//with this function, we are removing the spaces after and before of a string