PM-671 and PM-674 Validacion para la creacion de Dynaforms a traves de pm table

Validacion para PM table y Titulo de Dynaform.
This commit is contained in:
norahmollo
2014-10-23 14:08:45 -04:00
parent 0298c64de7
commit a24d041892
2 changed files with 15 additions and 11 deletions

View File

@@ -22,7 +22,7 @@
<td class="FormTitle" colspan="2" align="">{$form.TITLE}</td> <td class="FormTitle" colspan="2" align="">{$form.TITLE}</td>
</tr> </tr>
<tr id="pmtabledrop" style="display: none;"> <tr id="pmtabledrop" style="display: none;">
<td class="FormLabel" width="{$form_labelWidth}">{$ADD_TABLE}</td> <td class="FormLabel" width="{$form_labelWidth}"><font color="red">* </font>{$ADD_TABLE}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.ADD_TABLE} </td> //--> <!-- <td class='FormFieldContent' width="{$form_width}" >{$form.ADD_TABLE} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.ADD_TABLE}</td> <td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.ADD_TABLE}</td>
</tr> </tr>

View File

@@ -7,7 +7,7 @@
<TITLE type="title" group="1"> <TITLE type="title" group="1">
<en><![CDATA[Dynaform Information]]></en> <en><![CDATA[Dynaform Information]]></en>
</TITLE> </TITLE>
<ADD_TABLE type="dropdown" sqlConnection="dbarray"> <ADD_TABLE type="dropdown" sqlConnection="dbarray" required="1">
SELECT * FROM ADDITIONAL_TABLES SELECT * FROM ADDITIONAL_TABLES
<en><![CDATA[Create from a PM Table]]></en> <en><![CDATA[Create from a PM Table]]></en>
</ADD_TABLE> </ADD_TABLE>
@@ -164,9 +164,8 @@ document.getElementById('form[DYN_TITLE]').value = document.getElementById('form
} }
var oPanel; var oPanel;
function assignVariables(){ function assignVariables(){
//alert("test");
if ((document.getElementById('form[ADD_TABLE]').value!='') && (document.getElementById('form[DYN_TITLE]').value!='')) {
if(document.getElementById('form[ADD_TABLE]').value!=''){
table_uid = document.getElementById('form[ADD_TABLE]').value; table_uid = document.getElementById('form[ADD_TABLE]').value;
oPanel = new leimnud.module.panel(); oPanel = new leimnud.module.panel();
oPanel.options = { oPanel.options = {
@@ -190,14 +189,12 @@ document.getElementById('form[DYN_TITLE]').value = document.getElementById('form
var ACTION = document.getElementById('form[ACTION]').value; var ACTION = document.getElementById('form[ACTION]').value;
var DYN_DESCRIPTION = document.getElementById('form[DYN_DESCRIPTION]').value; var DYN_DESCRIPTION = document.getElementById('form[DYN_DESCRIPTION]').value;
//alert("pepe2");
oRPC = new leimnud.module.rpc.xmlhttp({ oRPC = new leimnud.module.rpc.xmlhttp({
url : '../dynaforms/dynaforms_AssignVariables', url : '../dynaforms/dynaforms_AssignVariables',
method : 'POST', method : 'POST',
args : 'PRO_UID=' + PRO_UID + '&DYN_UID=' + DYN_UID + '&ADD_TABLE=' + ADD_TABLE + '&DYN_TITLE=' + DYN_TITLE + '&DYN_TYPE=' + DYN_TYPE + '&DYN_DESCRIPTION=' + DYN_DESCRIPTION + '&ACTION=' + ACTION args : 'PRO_UID=' + PRO_UID + '&DYN_UID=' + DYN_UID + '&ADD_TABLE=' + ADD_TABLE + '&DYN_TITLE=' + DYN_TITLE + '&DYN_TYPE=' + DYN_TYPE + '&DYN_DESCRIPTION=' + DYN_DESCRIPTION + '&ACTION=' + ACTION
}); });
//alert("alert");
oRPC.callback = function(oRPC) { oRPC.callback = function(oRPC) {
oPanel.loader.hide(); oPanel.loader.hide();
var scs = oRPC.xmlhttp.responseText.extractScript(); var scs = oRPC.xmlhttp.responseText.extractScript();
@@ -206,10 +203,17 @@ document.getElementById('form[DYN_TITLE]').value = document.getElementById('form
}.extend(this); }.extend(this);
oRPC.make(); oRPC.make();
lastPopupWindow.remove(); lastPopupWindow.remove();
} else {
if (document.getElementById('form[ADD_TABLE]').value == '') {
//popupWindow('Assign Variable', '?PRO_UID=@%PRO_UID&TABLE_UID='+table_uid , 500, 300); msgBox("@G::LoadTranslation(ID_PMTABLE)"+" "+"@G::LoadTranslation(ID_IS_REQUIRED)", "alert");
return false;
} else {
msgBox("@G::LoadTranslation(ID_REQUIRED_NAME_DYNAFORM)", "alert");
return false;
}
} }
} }
function cancel(){ function cancel(){