Fixed problem creating triggers both wizard and no wizard

This commit is contained in:
Alvaro Campos
2011-01-17 13:53:45 +00:00
parent afcf856245
commit a386af9b63
4 changed files with 53 additions and 20 deletions

View File

@@ -20,7 +20,7 @@
<TRI_WEBBOT type="textareapm" class="formLabel" cols="50" rows="15" width="100%" height="380px" showVars="1" process="@#PRO_UID">
</TRI_WEBBOT>
<SAVE type="button" onclick="triggerSave(this.form);">
<SAVE type="button" onclick="triggerSave1(this.form);">
<en>Save</en>
</SAVE>
<BTN_CANCEL type="button" onclick="cancel();triggerFromLibrary()">
@@ -87,4 +87,4 @@ function cancel(){
}
]]></JS>
</dynaForm>
</dynaForm>

View File

@@ -80,28 +80,60 @@
function triggerSave(form)
{
var triUid = getField('TRI_UID').value;
if(triUid==''){
var triTitle =getField('TRI_TITLE').value;
var triUid = "";
if(document.getElementById('TRI_UID')) { // alert('alvaro2');
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(form.action,'lookforNameTrigger','NAMETRIGGER='+encodeURIComponent(triTitle)+'&proUid='+encodeURIComponent(getField('PRO_UID').value),'POST') ;
}
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;
alert(G_STRINGS.ID_EXIST_TRIGGERS);return false;
}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();
}
}else{
}else{ alert('alvaro888');
ajax_post(form.action, form, 'POST');
currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh();
}
}
//for trigger no wizard
function triggerSave1(form)
{
var triUid = "";
if(getField('TRI_UID')) { // alert('alvaro2');
var triUid = getField('TRI_UID').value;
}
if(triUid==''){
var triTitle =getField('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='+(getField('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{ alert('alvaro888');
ajax_post(form.action, form, 'POST');
currentPopupWindow.remove();
@#PAGED_TABLE_ID.refresh();
}
}
//end for trigger no wirzard
function triggerDelete(sUID) {
var validateResult;
@@ -145,4 +177,4 @@
<SEARCH_FILTER_FORM type="private"/>
</dynaForm>
</dynaForm>