<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="intputdocs/inputdocs_Edit" type="xmlform" width="100%" enableTemplate="1">
  <PRO_UID type="hidden" showInTable="0"/>
  <INP_DOC_UID type="hidden" showInTable="0"/>
		<INP_DOC_UPLOAD_MAX_FILESIZE type="hidden" showInTable="0" />
  <TITLE type="title" group="1">
    <en><![CDATA[Input Document Information]]></en>
  </TITLE>
  <INP_DOC_TITLE type="text" maxlength="100" size="50" colWidth="200" titleAlign="left" align="left" dataCompareField="T.CON_VALUE" dataCompareType="contains">
    <en><![CDATA[Title]]></en>
  </INP_DOC_TITLE>
  <INP_DOC_FORM_NEEDED type="dropdown" colWidth="80" titleAlign="left" align="left" dataCompareField="INP_DOC_FORM_NEEDED" dataCompareType="=">
    <en><![CDATA[Document Type]]><option name="VIRTUAL"><![CDATA[Digital]]></option><option name="REAL"><![CDATA[Printed]]></option><option name="VREAL"><![CDATA[Digital/Printed]]></option></en>
  </INP_DOC_FORM_NEEDED>
  <INP_DOC_ORIGINAL type="dropdown" colWidth="80" titleAlign="left" align="left" dataCompareField="INP_DOC_ORIGINAL" dataCompareType="=">
    <en><![CDATA[Format]]><option name="ORIGINAL"><![CDATA[Original]]></option><option name="COPYLEGAL"><![CDATA[Legal Copy]]></option><option name="COPY"><![CDATA[Copy]]></option></en>
  </INP_DOC_ORIGINAL>
  <INP_DOC_DESCRIPTION type="textarea" rows="5" cols="60" colWidth="200" titleAlign="left" align="left" dataCompareField="D.CON_VALUE" dataCompareType="contains">
    <en><![CDATA[Description]]></en>
  </INP_DOC_DESCRIPTION>
  <INP_DOC_VERSIONING type="dropdown">
    <en><![CDATA[Enable Versioning]]><option name=""><![CDATA[NO]]></option><option name="1"><![CDATA[YES]]></option></en>
  </INP_DOC_VERSIONING>
  <INP_DOC_DESTINATION_PATH type="textpm" size="30" maxlength="200" showVars="1" process="@#PRO_UID" symbol="@#" validate="Path">
    <en><![CDATA[Destination Path]]></en>
  </INP_DOC_DESTINATION_PATH>
  <INP_DOC_TAGS type="textpm" size="30" maxlength="200" showVars="1" process="@#PRO_UID" symbol="@#" validate="Tag">
    <en><![CDATA[Tags]]></en>
  </INP_DOC_TAGS>
  <INP_DOC_TYPE_FILE type="text" defaultvalue="*.*" maxlength="200" size="37" colWidth="200" titleAlign="left" align="left" hint="Configure many extensions separated by comas. e.g *.jpg,*.png,*.bmp. Enable the FILEINFO module to verify the content and the extension of a file. If this is not enabled, the content won\'t be verified." dataCompareField="T.CON_VALUE" dataCompareType="contains">
    <en><![CDATA[Allowed file extensions (Use *.* to allow any extension)]]></en>
  </INP_DOC_TYPE_FILE>

  <INP_DOC_MAX_FILESIZE type="text" defaultvalue="0" maxlength="10" size="8" mode="edit">
      <en>Maximum file size (Use zero if unlimited)</en>
  </INP_DOC_MAX_FILESIZE>

  <INP_DOC_MAX_FILESIZE_UNIT type="dropdown" colWidth="80" titleAlign="left" align="left">
      <en>
          <option name="KB">KB</option>
          <option name="MB">MB</option>
      </en>
  </INP_DOC_MAX_FILESIZE_UNIT>

  <INP_DOC_UPLOAD_MAX_FILESIZE_LABEL type="text" maxlength="30" validate="Any" size="10" mode="view">
      <en>Maximum upload file size</en>
  </INP_DOC_UPLOAD_MAX_FILESIZE_LABEL>

  <BTN_CANCEL type="button" onclick="cancel();">
    <en><![CDATA[Cancel]]></en>
  </BTN_CANCEL>
  <ACCEPT type="button" onclick="inputdocsSave( this.form );">
    <en><![CDATA[Save]]></en>
  </ACCEPT>
  <JS type="javascript"><![CDATA[



leimnud.event.add(getField('INP_DOC_FORM_NEEDED'), 'change', function() {
  if (getField('INP_DOC_FORM_NEEDED').value == 'VIRTUAL') {
    hideRow('INP_DOC_ORIGINAL');
  }
  else {
    showRow('INP_DOC_ORIGINAL');
  }
});
if (getField('INP_DOC_FORM_NEEDED').value == 'VIRTUAL') {
  hideRow('INP_DOC_ORIGINAL');
}

var _oVarsPanel_;
var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) {
	_oVarsPanel_ = new leimnud.module.panel();
	_oVarsPanel_.options = {
    limit    : true,
    size     : {w:600,h:420},
    position : {x:0,y:0,center:true},
    title    : '',
    theme    : 'processmaker',
    statusBar: false,
    control  : {drag:false,resize:true,close:true},
    fx       : {opacity:true,rolled:false,modal:true}
  };
  _oVarsPanel_.make();
  _oVarsPanel_.events = {
    remove:function() {
      delete _oVarsPanel_;
    }.extend(this)
  };
  _oVarsPanel_.loader.show();
  oRPC = new leimnud.module.rpc.xmlhttp({
    url   : sAjaxServer,
    method: 'POST',
    args  : 'sFieldName=' + sFieldName + '&sProcess=' + sProcess + '&sSymbol=' + sSymbol + '&sType=2'
  });
  oRPC.callback = function(oRPC) {
    _oVarsPanel_.loader.hide();
    var scs = oRPC.xmlhttp.responseText.extractScript();
    _oVarsPanel_.addContent(oRPC.xmlhttp.responseText);
    scs.evalScript();
  }.extend(this);
  oRPC.make();
};

var insertFormVar = function(sFieldName, sValue) {
	oAux = document.getElementById(sFieldName);
	if (oAux.setSelectionRange) {
		var rangeStart = oAux.selectionStart;
    var rangeEnd   = oAux.selectionEnd;
    var tempStr1   = oAux.value.substring(0,rangeStart);
    var tempStr2   = oAux.value.substring(rangeEnd);
    oAux.value     = tempStr1 + sValue + tempStr2;
	}
	else {
	  if (document.selection) {
	    oAux.focus();
      document.selection.createRange().text = sValue;
	  }
	}
	_oVarsPanel_.remove();
};

function cancel(){
    currentPopupWindow.remove();
}
]]></JS>
</dynaForm>
