<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="tasks_Labels" width="99%" mode="edit" enableTemplate="0" border="0" height="305px">
  <PRO_UID type="private"/>
  <TAS_UID type="hidden"/>
  <INDEX type="hidden"/>
  <IFORM type="hidden"/>
  <TAS_DEF_TITLE type="textareapm" required="0" cols="42" rows="5" group="1" showVars="1" process="@#PRO_UID" symbol="@#">
    <en><![CDATA[Case Title]]></en>
  </TAS_DEF_TITLE>
  <TAS_DEF_DESCRIPTION type="textareapm" required="0" cols="42" rows="5" group="1" showVars="1" process="@#PRO_UID" symbol="@#">
    <en><![CDATA[Case Description]]></en>
  </TAS_DEF_DESCRIPTION>
  <JS type="javascript"><![CDATA[

/* Recovery data */
if (aTaskFlag[5])
{
  getField('TAS_DEF_TITLE').value       = oTaskData.TAS_DEF_TITLE;
  getField('TAS_DEF_DESCRIPTION').value = oTaskData.TAS_DEF_DESCRIPTION;
  //getField('TAS_DEF_PROC_CODE').value   = oTaskData.TAS_DEF_PROC_CODE;
}
else
{
  saveDataTaskTemporal(6);
  aTaskFlag[5] = true;
}

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();
};

]]></JS>
</dynaForm>
