Nuevo campo en Input Documents, dicho campo acepta las extensiones de los inputdocs permitidos. Se agregaron validaciones para que funcione correctamente
75 lines
2.0 KiB
XML
Executable File
75 lines
2.0 KiB
XML
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<dynaForm name="cases_AttachInputDocument1" type="xmlform" width="500px" labelWidth="120px" enableTemplate="1">
|
|
<TYPE_LABEL type="private"/>
|
|
<APP_DOC_TYPE type="hidden" defaultValue="INPUT"/>
|
|
<DOC_UID type="hidden"/>
|
|
<APP_DOC_UID type="hidden"/>
|
|
<actionType type="hidden"/>
|
|
<docVersion type="hidden"/>
|
|
<fileTypes type="hidden"/>
|
|
<APP_DOC_FILENAME type="file">
|
|
<en><![CDATA[File]]></en>
|
|
</APP_DOC_FILENAME>
|
|
<APP_DOC_COMMENT type="textarea" rows="5" cols="32" colWidth="200" titleAlign="left" align="left">
|
|
<en><![CDATA[Comments]]></en>
|
|
</APP_DOC_COMMENT>
|
|
<MORE type="hidden">
|
|
<en>Upload Multiple Input Documents</en>
|
|
</MORE>
|
|
<BTN_CANCEL type="button" onclick="cancel();">
|
|
<en><![CDATA[Cancel]]></en>
|
|
</BTN_CANCEL>
|
|
<SAVE type="button" onclick="verifyInfo(this.form);">
|
|
<en><![CDATA[Save]]></en>
|
|
</SAVE>
|
|
<MESSAGE1 type="phpvariable"/>
|
|
<MESSAGE2 type="phpvariable"/>
|
|
<JS type="javascript"><![CDATA[
|
|
leimnud.event.add(window, 'load', function() {
|
|
if (getField('INP_DOC_FORM_NEEDED').value == 'VIRTUAL') {
|
|
hideRow('INP_DOC_ORIGINAL');
|
|
}
|
|
});
|
|
|
|
var verifyInfo = function(oForm)
|
|
{
|
|
oAux = getField('APP_DOC_FILENAME');
|
|
if (oAux.value == '')
|
|
{
|
|
alert('@G::LoadTranslation(ID_PLEASE_SELECT_FILE)');
|
|
oAux.focus();
|
|
return;
|
|
}
|
|
|
|
docType = oAux.value.split(".");
|
|
docType = docType[docType.length - 1];
|
|
|
|
allowedTypes = getField('fileTypes').value.split(", ");
|
|
|
|
for(i=0; i<allowedTypes.length; i++){
|
|
allowed = allowedTypes[i].replace('*','').replace('.','');
|
|
if((allowed != '*') && (docType != allowed)){
|
|
flag = 1;
|
|
} else {
|
|
flag = 0;
|
|
i = allowedTypes.length;
|
|
}
|
|
}
|
|
if( flag == 1){
|
|
alert('@G::LoadTranslation(ID_UPLOAD_ERR_NOT_ALLOWED_EXTENSION)');
|
|
oAux.focus();
|
|
return;
|
|
}
|
|
|
|
getField('SAVE').disabled = true;
|
|
getField('BTN_CANCEL').disabled = true;
|
|
oForm.submit();
|
|
};
|
|
|
|
function cancel(){
|
|
oPanel.remove();
|
|
}
|
|
|
|
]]></JS>
|
|
</dynaForm>
|