Commit 5245e1cc by Billy Larru

[EDIT registro de justificacion, agregando motivos de justificacion]

parent 36e186e6
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package horarioprimaria.utilities;
import java.io.File;
import java.util.Locale;
/**
*
* @author sistem08user
*/
public final class OsUtils {
/**
* types of Operating Systems
*/
public enum OSType {
Windows, MacOS, Linux, Other
};
// cached result of OS detection
protected static String detectedOS;
/**
* detect the operating system from the os.name System property and cache the
* result
*
* @return - the operating system detected
*/
public static String getOperatingSysstemType() {
if (detectedOS == null) {
String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
if ((OS.contains("mac")) || (OS.contains("darwin"))) {
detectedOS = "MacOS";
} else if (OS.contains("win")) {
detectedOS = "Windows";
} else if (OS.contains("nux")) {
detectedOS = "Linux";
} else {
detectedOS = "Other";
}
}
return detectedOS;
}
public static String getPathOfVouchersDependingOS() {
String path = "";
String detectedOs = OsUtils.getOperatingSysstemType();
switch (detectedOs) {
case "MacOS":
path = "";
break;
case "Windows":
path = "C:/AppServ/www/comprobantes";
break;
case "Linux":
path = "/var/www/html/comprobantes";
break;
}
return path;
}
public static String getJSONDependingOS() {
String path = "";
String detectedOs = OsUtils.getOperatingSysstemType();
switch (detectedOs) {
case "MacOS":
path = "";
break;
case "Windows":
path = "C:/AppServ/www/comprobantes-log";
break;
case "Linux":
path = "/var/www/html/comprobantes-log";
break;
}
return path;
}
public static String getDotEnvPath(String nameProject) {
String path = "";
String detectedOs = OsUtils.getOperatingSysstemType();
switch (detectedOs) {
case "MacOS":
path = "";
break;
case "Windows":
char[] alphabet = "abcdefghijklmnopqrstuvwxyz".toCharArray();
for (char letter : alphabet) {
path = letter + ":/dotenv/" + nameProject;
File directory = new File(path);
if (directory.exists()) {
break;
}
}
break;
case "Linux":
path = "/opt/dotenv/" + nameProject;
break;
}
return path;
}
}
......@@ -51,6 +51,7 @@ const URI_ADMINISTRATIVOS_DESCUENTO_MENSUAL_DETALLADO = "descuentoAsistenciaAdmi
//</editor-fold>
const URI_SEDES = "sedes";
const URI_JUSTIFICACION_CAUSA = "causaJustificacion"
const URI_JUSTIFICACION_TIPO = "tipoJustificacion"
const URI_JUSTIFICACION = "justificaciones"
const URI_ESTADOJUSTIFICACION = "estadoJustificaciones"
......
......@@ -2,11 +2,21 @@ const listarPersonal = (selectorName) => {
initSelect2(selectorName, baseURLRest + URI_TRABAJADORES, {title: "nombresapellidos", subtitle: "documentoidentidad"});
};
const listarCausaJustificacion = (nodeIdentifier) => {
ajaxWebService.get(URI_JUSTIFICACION_CAUSA).then((response) => {
let data = response.data
let html = "<option>[SELECCIONE]</option>"
html += data.map((causaJustificacion) => `<option value="${causaJustificacion.id}">${causaJustificacion.descripcion}</option>`).join("")
$(nodeIdentifier).html(html)
})
}
const listarTipoJustificacion = (nodeIdentifier) => {
ajaxWebService.get(URI_JUSTIFICACION_TIPO).then((response) => {
let data = response.data
let html = "<option>[SELECCIONE]</option>"
html += data.map((tipoJustificacion) => `<option value="${tipoJustificacion.id}">${tipoJustificacion.descripcion}</option>`)
html += data.map((tipoJustificacion) => `<option value="${tipoJustificacion.id}">${tipoJustificacion.descripcion}</option>`).join("")
$(nodeIdentifier).html(html)
})
}
......@@ -17,6 +27,9 @@ const formControls = {
this.initializeChooseFile()
pickersNoConflict()
initDateRangePicker("#dpRangoFechas")
listarCausaJustificacion("#cboCausaJustificacion")
listarTipoJustificacion("#cboTipoJustificacion")
listarPersonal("#cboPersonal")
},
initializeRadioButton() {
$(".styled, .multiselect-container input").uniform({
......@@ -163,7 +176,5 @@ const registrarJustificacion = () => {
$(document).ready(function () {
formControls.init()
listarTipoJustificacion("#cboTipoJustificacion")
listarPersonal("#cboPersonal")
$("#btnRegistrar").click(registrarJustificacion)
});
\ No newline at end of file
!function(a){a.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy",monthsTitle:"Meses",clear:"Borrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery);
\ No newline at end of file
......@@ -87,7 +87,7 @@
<script src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script src="../js/lib/sweetalert2.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/locales/bootstrap-datepicker.es.min.js" type="text/javascript"></script>
<script src="../js/pages/control_asistencia_administrativa.js" type="text/javascript"></script>
<!--js-->
......
......@@ -20,12 +20,12 @@
<div class="panel-body">
<div class="row">
<div class="col-md-4 form-group">
<div class="col-md-3 form-group">
<label>Personal</label>
<select class="select-search form-control" id="cboPersonal">
</select>
</div>
<div class="col-md-4 form-group">
<div class="col-md-3 form-group">
<label>Fecha(s) a justificar</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
......@@ -33,11 +33,11 @@
</div>
</div>
<div class="col-md-2 form-group">
<div class="col-md-3 form-group">
<label>Justificacion por</label>
<select id="cboTipoJustificacion" class="form-control"></select>
<select id="cboCausaJustificacion" class="form-control"></select>
</div>
<div class="col-md-2 form-group hidden" id="divHora">
<div class="col-md-3 form-group hidden" id="divHora">
<label>Hora</label>
<input type="time" id="txtHora" class="form-control"></select>
</div>
......@@ -50,6 +50,14 @@
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Tipo de justificación</label>
<select id="cboTipoJustificacion" class="form-control">
</select>
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Observación/Fundamento</label>
<textarea id="txtObservacion" cols="30" rows="5" class="form-control"></textarea>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment