Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function displayFields(form, customHTML) {
- var numSolicitacao = getValue("WKNumProces");
- var atividade = getValue("WKNumState");
- var WKNumProces = getValue("WKNumProces");
- var FORM_MODE = form.getFormMode();
- var usuarioLogado = getValue("WKUser");
- var fluigMobile = form.getMobile();
- var dadosUsario = consultaUsuario(usuarioLogado);
- var nomeUsuario = dadosUsario.nome;
- var emailUsuario = dadosUsario.mail;
- form.setValue("numSolicitacao", numSolicitacao);
- customHTML.append("\n<script>function getUser(){ return '" + getValue("WKUser") + "'; }</script>");
- customHTML.append("\n<script>function getUserName(){ return '" + nomeUsuario + "'; }</script>");
- customHTML.append("\n<script>function getUserMail(){ return '" + emailUsuario + "'; }</script>");
- // Trabalhando com campos personalizados
- customHTML.append("\n<script>\n");
- if (atividade == 0 || atividade == 4) {
- customHTML.append('\n $("usuarioLogado").val(' + usuarioLogado + ');');
- customHTML.append('');
- }
- customHTML.append("\n</script>\n");
- }
- function getData() {
- var data = new Date();
- var dia = data.getDate();
- var mes = data.getMonth() + 1;
- var ano = data.getFullYear();
- dia = (dia <= 9 ? "0" + dia : dia);
- mes = (mes <= 9 ? "0" + mes : mes);
- var novaData = ano + "/" + mes + "/" + dia;
- return novaData;
- }
- function consultaUsuario(usuario) {
- var c1 = DatasetFactory.createConstraint("colleaguePK.colleagueId", usuario, usuario, ConstraintType.MUST);
- retorno = DatasetFactory.getDataset('colleague', null, new Array(c1), null);
- for (var i = 0; i < retorno.rowsCount; i++) {
- var nomeUsuario = retorno.getValue(i, "colleagueName");
- var email = retorno.getValue(i, "mail");
- }
- var newObject = new Object();
- newObject.nome = nomeUsuario;
- newObject.mail = email;
- return newObject;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement