function displayFields(form,customHTML){ var state = getValue("WKNumState"); customHTML.append(" \n"); } function bloqueiaCampos(customHTML,id) { customHTML.append(" $('"+id+" .input-group-addon').removeAttr('onclick'); \n"); customHTML.append(" $('"+id+" input').attr('readonly',true); \n"); customHTML.append(" $('"+id+" textarea').attr('readonly',true); \n"); customHTML.append(" $('"+id+" select option:not(:selected)').attr('disabled', 'true'); \n"); customHTML.append(" $('"+id+"').attr('onclick', 'return false'); \n"); customHTML.append(" $('"+id+" .fluigicon-trash').removeAttr('onclick'); \n"); customHTML.append(" $('"+id+" input').removeAttr('onclick'); \n"); } function ocultaCampos(customHTML,id) { customHTML.append(" $('"+id+"').attr('style','display:none;'); \n"); } function preencheDadosSolicitante(form,customHTML) { var user = getValue("WKUser"); var b1 = DatasetFactory.createConstraint("colleaguePK.colleagueId",user , user, ConstraintType.MUST); var constraints = new Array(b1); var dataset = DatasetFactory.getDataset("colleague", null, constraints, null); if (dataset.rowsCount > 0) { form.setValue("nm_solicitante",dataset.getValue(0, "colleagueName")); } form.setValue("dt_solic",dateBase()); } function dateBase() { var now = new Date(); var year = "" + now.getFullYear(); var month = "" + (now.getMonth() + 1); //Deve somar um no mês pois a função getMonth retorna valores entre 0 e 11 var day = "" + now.getDate(); return FormattedDateTime(day) +"/" + FormattedDateTime(month) +"/"+ year; } function FormattedDateTime(dateTime) { if (dateTime.length == 1) { dateTime = "0" + dateTime; } return dateTime; }