Ask questions about installing and configuring ProcessMaker 3
By diegoesolutions
#794573
Estimados, quisiera vuestra ayuda con un problema que tengo, necesito generar fechas variables de min Date y max Date para un campo datetime en dynaform de processmaker 3.

Busqué en el manual y me aparece el siguiente ejemplo.
Code: Select all
if (!isset(@@dueDate) or empty(@@dueDate)) {
   @@minDate = date('Y-m-01', strtotime('+1 month'));
   @@maxDate = date('Y-m-t', strtotime('+1 month'));
   @@defaultDate = date('Y-m-15', strtotime('+1 month'));
}
elseif {
   @@minDate = date('Y-m-01', strtotime(@@dueDate));
   @@maxDate = date('Y-m-t', strtotime(@@dueDate));
   @@defaultDate = date('Y-m-15', strtotime(@@dueDate));
}
Asigno esas variables al datetime control, como min date y max date respectivamente.

Si utilizo este ejemplo se me queda pegado el dynaform y no vuelve a cargar mas el formulario.

Gracias.
Saludos
User avatar
By amosbatto
#794575
Hay un error en el "elseif" porque falta una condición. Debe ser así:
Code: Select all
if (!isset(@@dueDate) or empty(@@dueDate)) {
   @@minDate = date('Y-m-01', strtotime('+1 month'));
   @@maxDate = date('Y-m-t', strtotime('+1 month'));
   @@defaultDate = date('Y-m-15', strtotime('+1 month'));
}
else {
   @@minDate = date('Y-m-01', strtotime(@@dueDate));
   @@maxDate = date('Y-m-t', strtotime(@@dueDate));
   @@defaultDate = date('Y-m-15', strtotime(@@dueDate));
}
Cuando tienes código en un trigger, puedes depurarlo usando el Debugger y chequeando los mensajes en la variable del sistema @@__ERROR__. Ver: http://wiki.processmaker.com/3.0/Trigge ... g_Triggers
By diegoesolutions
#794722
Muchas Gracias por la ayuda, pero tengo otro problema, que cuando asigno esas variables el formulario queda cargando y se queda así. Nunca termina de cargar entonces no puedo realizar ninguna prueba. La condición que te envié la quiero ejecutar desde javascript.

Adjunto algunas imagenes por si me pueden ayudarme.
Gracias.
Saludos.
Attachments
Imagen3.JPG
Imagen3.JPG (139.56 KiB) Viewed 7106 times
Imagen2.JPG
Imagen2.JPG (69.75 KiB) Viewed 7106 times
Imagen1.JPG
Imagen1.JPG (11.48 KiB) Viewed 7106 times
By diegoesolutions
#794766
Estimado, necesito bloquear el campo de fecha que tengo creado pero dejar funcional el calendario, que se pueda solo cambiar la fecha desde el calendario y no editarlo de formal manual.

Gracias por tu ayuda.
Saludos.
User avatar
By amosbatto
#794769
diegoesolutions wrote:necesito bloquear el campo de fecha que tengo creado pero dejar funcional el calendario, que se pueda solo cambiar la fecha desde el calendario y no editarlo de formal manual.
Puedes usar este JavaScript:
Code: Select all
$("#form\\[dueDate\\]").prop("readOnly", true);
Donde "dueDate" es la ID del campo datetime.

También puedes usar este código si quieres filtrar por teclas especiales en el campo:
Code: Select all
$("#form\\[dueDate\\]").keypress( function(e) {
  e = e || window.event;
  var charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;
  
  var aAllowedKeys = [
    9, //tab
    13, //enter
    16, //shift
    17, //control
    18, //alt
    19, //pause/break
    20, //caps lock
    27, //escape
    33, //page up
    34, //page down
    35, //end
    36, //home
    37, //left arrow
    38, //up arrow
    39, //right arrow
    40, //down arrow
    45, //insert
    91, //Windows key/Mac select
    112, //F1
    113, //F2
    114,
    115,
    116,
    117,
    118,
    119,
    120,
    121,
    122,
    123, //F12
    144, //num lock
    145, //scroll lock
    225  //altgr
  ];    
    
  if (aAllowedKeys.indexOf(charCode) != -1) {
    return false;
  }
});

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]