From 48e06fef1f9291ac79d1846e6d259acbfcccbbd1 Mon Sep 17 00:00:00 2001 From: Melina Gutierrez Date: Fri, 15 Nov 2024 07:25:19 -0400 Subject: [PATCH] Formulario de registro de horas trabajadas corregir formato --- .../primefactorsolutions/model/Actividad.java | 204 ------------------ .../model/ActividadesHours.java | 81 ------- .../primefactorsolutions/model/Employee.java | 6 +- .../model/HoursWorked.java | 19 +- .../ActividadesHoursRepository.java | 7 - .../service/HoursWorkedService.java | 4 +- .../views/EmployeeView.java | 6 +- .../views/HoursWorkedListView.java | 9 +- .../views/HoursWorkedMonthView.java | 161 -------------- .../views/HoursWorkedView.java | 26 ++- 10 files changed, 36 insertions(+), 487 deletions(-) delete mode 100644 src/main/java/com/primefactorsolutions/model/Actividad.java delete mode 100644 src/main/java/com/primefactorsolutions/model/ActividadesHours.java delete mode 100644 src/main/java/com/primefactorsolutions/repositories/ActividadesHoursRepository.java delete mode 100644 src/main/java/com/primefactorsolutions/views/HoursWorkedMonthView.java diff --git a/src/main/java/com/primefactorsolutions/model/Actividad.java b/src/main/java/com/primefactorsolutions/model/Actividad.java deleted file mode 100644 index 717e3aa..0000000 --- a/src/main/java/com/primefactorsolutions/model/Actividad.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.primefactorsolutions.model; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.UUID; - -@Data -@Entity -@AllArgsConstructor -@EqualsAndHashCode(callSuper = true) -public class Actividad extends BaseEntity { - @Id - @GeneratedValue(strategy = GenerationType.UUID) - private UUID id; - - private String nombre; - private double lunes; - private double martes; - private double miercoles; - private double jueves; - private double viernes; - private double sabado; - private double domingo; - private String tarea; - private double horas; - - public Actividad() {} - - public Actividad(final Builder builder) { - this.nombre = builder.nombre; - this.lunes = builder.lunes; - this.martes = builder.martes; - this.miercoles = builder.miercoles; - this.jueves = builder.jueves; - this.viernes = builder.viernes; - this.sabado = builder.sabado; - this.domingo = builder.domingo; - this.tarea = builder.tarea; - this.horas = builder.horas; - } - - public String setNombre(final String nombre) { - this.nombre = nombre; - return nombre; - } - - public String getNombre() { - return nombre; - } - - public void setLunes(double lunes) { - this.lunes = lunes; - return; - } - - public void setMartes(double martes) { - this.martes = martes; - return; - } - - public void setMiercoles(double miercoles) { - this.miercoles = miercoles; - return; - } - - public void setJueves(double jueves) { - this.jueves = jueves; - return; - } - - public void setViernes(double viernes) { - this.viernes = viernes; - return; - } - - public void setSabado(double sabado) { - this.sabado = sabado; - return; - } - - public void setDomingo(double domingo) { - this.domingo = domingo; - return; - } - public void setTarea(String tarea) { - this.tarea = tarea; - return; - } - - public void setHoras(double horas) { - this.horas = horas; - return; - } - - public double getLunes() { - return lunes; - } - - public double getMartes() { - return martes; - } - - public double getMiercoles() { - return miercoles; - } - - public double getJueves() { - return jueves; - } - - public double getViernes() { - return viernes; - } - - public double getSabado() { - return sabado; - } - - public double getDomingo() { - return domingo; - } - - public String getTarea() { // Cambié aquí también - return tarea; - } - - public double getHoras() { - return horas; - } - - public static class Builder { - private String nombre; - private double lunes; - private double martes; - private double miercoles; - private double jueves; - private double viernes; - private double sabado; - private double domingo; - private String tarea; - private double horas; - - public Builder tarea(final String tarea, final double horas) { - this.tarea = tarea; - this.horas = horas; - return this; - } - - public Builder tarea(final String tarea) { - this.tarea = tarea; - return this; - } - - public Builder nombre(final String nombre) { - this.nombre = nombre; - return this; - } - - public Builder lunes(final double horas) { - this.lunes = horas; - return this; - } - - public Builder martes(final double horas) { - this.martes = horas; - return this; - } - - public Builder miercoles(final double horas) { - this.miercoles = horas; - return this; - } - - public Builder jueves(final double horas) { - this.jueves = horas; - return this; - } - - public Builder viernes(final double horas) { - this.viernes = horas; - return this; - } - - public Builder sabado(final double horas) { - this.sabado = horas; - return this; - } - - public Builder domingo(final double horas) { - this.domingo = horas; - return this; - } - - public Actividad build() { - return new Actividad(this); - } - } -} diff --git a/src/main/java/com/primefactorsolutions/model/ActividadesHours.java b/src/main/java/com/primefactorsolutions/model/ActividadesHours.java deleted file mode 100644 index 5a93ec4..0000000 --- a/src/main/java/com/primefactorsolutions/model/ActividadesHours.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.primefactorsolutions.model; - -import jakarta.persistence.*; -import java.time.LocalDate; -import java.util.UUID; - -@Entity -@Table(name = "Actividades_hours") -public class ActividadesHours { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private UUID id; - - @ManyToOne - @JoinColumn(name = "employee_id", nullable = false) - private Employee employee; - - @ManyToOne - @JoinColumn(name = "actividad_id", nullable = false) - private Actividad actividad; - - @Column(nullable = false) - private double totalHours; - - @Column(nullable = false) - private int weekNumber; - - @Column(nullable = false) - private LocalDate fecha; - - // Getters y Setters - - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public Employee getEmployee() { - return employee; - } - - public void setEmployee(Employee employee) { - this.employee = employee; - } - - public Actividad getActividad() { - return actividad; - } - - public void setActividad(Actividad actividad) { - this.actividad = actividad; - } - - public double getTotalHours() { - return totalHours; - } - - public void setTotalHours(double totalHours) { - this.totalHours = totalHours; - } - - public int getWeekNumber() { - return weekNumber; - } - - public void setWeekNumber(int weekNumber) { - this.weekNumber = weekNumber; - } - - public LocalDate getFecha() { - return fecha; - } - - public void setFecha(LocalDate fecha) { - this.fecha = fecha; - } -} diff --git a/src/main/java/com/primefactorsolutions/model/Employee.java b/src/main/java/com/primefactorsolutions/model/Employee.java index 4d06336..f4d3236 100644 --- a/src/main/java/com/primefactorsolutions/model/Employee.java +++ b/src/main/java/com/primefactorsolutions/model/Employee.java @@ -47,10 +47,12 @@ public class Employee extends BaseEntity implements UserDetails { @JoinColumn(name = "team_id", nullable = false) private Team team; - @Pattern(regexp = "^[a-zA-Z ]+$", message = "El nombre y apellido de contacto de emergencia solo debe contener letras") + @Pattern(regexp = "^[a-zA-Z ]+$", message = "El nombre y apellido de contacto" + + " de emergencia solo debe contener letras") private String emergencyCName; private String emergencyCAddress; - @Pattern(regexp = "^[0-9]+$", message = "El teléfono de contacto de emergencia debe contener solo números") + @Pattern(regexp = "^[0-9]+$", message = "El teléfono de contacto de emergencia " + + " debe contener solo números") private String emergencyCPhone; @Email(message = "El correo de contacto de emergencia no tiene un formato válido") private String emergencyCEmail; diff --git a/src/main/java/com/primefactorsolutions/model/HoursWorked.java b/src/main/java/com/primefactorsolutions/model/HoursWorked.java index 519f99c..560a6eb 100644 --- a/src/main/java/com/primefactorsolutions/model/HoursWorked.java +++ b/src/main/java/com/primefactorsolutions/model/HoursWorked.java @@ -7,7 +7,6 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import java.time.LocalDate; -import java.util.UUID; @Data @Entity @@ -36,7 +35,7 @@ public class HoursWorked extends BaseEntity { return employee; } - public void setEmployee(Employee employee) { + public void setEmployee(final Employee employee) { this.employee = employee; } @@ -44,7 +43,7 @@ public class HoursWorked extends BaseEntity { return weekNumber; } - public void setWeekNumber(int weekNumber) { + public void setWeekNumber(final int weekNumber) { this.weekNumber = weekNumber; } @@ -52,7 +51,7 @@ public class HoursWorked extends BaseEntity { return date; } - public void setDate(LocalDate date) { + public void setDate(final LocalDate date) { this.date = date; } @@ -60,7 +59,7 @@ public class HoursWorked extends BaseEntity { return actividad; } - public void setActividad(String actividad) { + public void setActividad(final String actividad) { this.actividad = actividad; } @@ -68,7 +67,7 @@ public class HoursWorked extends BaseEntity { return hours; } - public void setHours(double hours) { + public void setHours(final double hours) { this.hours = hours; } @@ -76,7 +75,7 @@ public class HoursWorked extends BaseEntity { return totalHours; } - public void setTotalHours(double totalHours) { + public void setTotalHours(final double totalHours) { this.totalHours = totalHours; } @@ -84,7 +83,7 @@ public class HoursWorked extends BaseEntity { return team; } - public void setTeam(Team team) { + public void setTeam(final Team team) { this.team = team; } @@ -92,7 +91,7 @@ public class HoursWorked extends BaseEntity { return tareasEspecificas; } - public void setTareasEspecificas(String tareasEspecificas) { + public void setTareasEspecificas(final String tareasEspecificas) { this.tareasEspecificas = tareasEspecificas; } @@ -100,7 +99,7 @@ public class HoursWorked extends BaseEntity { return horasTareasEspecificas; } - public void setHorasTareasEspecificas(double horasTareasEspecificas) { + public void setHorasTareasEspecificas(final double horasTareasEspecificas) { this.tareasEspecificas = tareasEspecificas; } } diff --git a/src/main/java/com/primefactorsolutions/repositories/ActividadesHoursRepository.java b/src/main/java/com/primefactorsolutions/repositories/ActividadesHoursRepository.java deleted file mode 100644 index 72a3013..0000000 --- a/src/main/java/com/primefactorsolutions/repositories/ActividadesHoursRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.primefactorsolutions.repositories; -import com.primefactorsolutions.model.ActividadesHours; -import org.springframework.data.jpa.repository.JpaRepository; -import java.util.UUID; - -public interface ActividadesHoursRepository extends JpaRepository { -} diff --git a/src/main/java/com/primefactorsolutions/service/HoursWorkedService.java b/src/main/java/com/primefactorsolutions/service/HoursWorkedService.java index ed77e2e..dc1b220 100644 --- a/src/main/java/com/primefactorsolutions/service/HoursWorkedService.java +++ b/src/main/java/com/primefactorsolutions/service/HoursWorkedService.java @@ -1,6 +1,5 @@ package com.primefactorsolutions.service; -import com.primefactorsolutions.model.Employee; import com.primefactorsolutions.model.HoursWorked; import com.primefactorsolutions.repositories.HoursWorkedRepository; import org.apache.commons.beanutils.BeanComparator; @@ -9,7 +8,6 @@ import org.springframework.stereotype.Service; import java.time.LocalDate; import java.util.*; -import java.util.stream.Collectors; @Service public class HoursWorkedService { @@ -57,7 +55,7 @@ public class HoursWorkedService { int end = Math.min(start + pageSize, hoursWorkeds.size()); hoursWorkeds.sort(new BeanComparator<>(sortProperty)); - if(!asc) { + if (!asc) { Collections.reverse(hoursWorkeds); } diff --git a/src/main/java/com/primefactorsolutions/views/EmployeeView.java b/src/main/java/com/primefactorsolutions/views/EmployeeView.java index a80ae9e..4e34abb 100644 --- a/src/main/java/com/primefactorsolutions/views/EmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/EmployeeView.java @@ -64,9 +64,11 @@ public class EmployeeView extends BeanValidationForm implements HasUrl private final ComboBox gender = createGenderComboBox(); private final VDatePicker birthday = new VDatePicker("Fecha de Nacimiento"); private final TextField age = createTextField("Edad", 3, false); - private final TextField birthCity = createTextField("Ciudad y País de Nacimiento ejemplo: (Ciudad, País) ", 30, false); + private final TextField birthCity = createTextField("Ciudad y País de Nacimiento ejemplo: (Ciudad, País) ", + 30, false); private final TextField residenceAddress = createTextField("Dirección de Residencia", 50, false); - private final TextField localAddress = createTextField("Departamento y Provincia de Residencia ejemplo: (Departamento-Provincia)", 30, false); + private final TextField localAddress = createTextField("Departamento y Provincia de Residencia " + + " ejemplo: (Departamento-Provincia)", 30, false); private final ComboBox maritalStatus = createMaritalStatusComboBox(); private final TextField numberOfChildren = createTextField("Numero de Hijos", 2, false); private final TextField ci = createTextField("CI", 10, false); diff --git a/src/main/java/com/primefactorsolutions/views/HoursWorkedListView.java b/src/main/java/com/primefactorsolutions/views/HoursWorkedListView.java index fb20d2b..26def46 100644 --- a/src/main/java/com/primefactorsolutions/views/HoursWorkedListView.java +++ b/src/main/java/com/primefactorsolutions/views/HoursWorkedListView.java @@ -2,19 +2,14 @@ package com.primefactorsolutions.views; import com.primefactorsolutions.model.Employee; import com.primefactorsolutions.model.Team; -import com.primefactorsolutions.model.TimeOffRequest; -import com.primefactorsolutions.model.TimeOffRequestStatus; import com.primefactorsolutions.service.EmployeeService; import com.primefactorsolutions.service.HoursWorkedService; import com.primefactorsolutions.service.TeamService; import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.combobox.ComboBox; -import com.vaadin.flow.component.grid.GridSortOrder; -import com.vaadin.flow.component.html.H2; import com.vaadin.flow.component.html.Main; import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.component.orderedlayout.HorizontalLayout; -import com.vaadin.flow.data.provider.SortDirection; import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.Route; import com.vaadin.flow.spring.annotation.SpringComponent; @@ -153,7 +148,9 @@ public class HoursWorkedListView extends Main { return createButton("Agregar Actividad", this::navigateToHours); } - private void navigateToHours() { getUI().ifPresent(ui -> ui.navigate(HoursWorkedView.class, "new"));} + private void navigateToHours() { + getUI().ifPresent(ui -> ui.navigate(HoursWorkedView.class, "new")); + } private ComboBox createEmployeeFilter() { employeeFilter = new ComboBox<>("Empleado"); diff --git a/src/main/java/com/primefactorsolutions/views/HoursWorkedMonthView.java b/src/main/java/com/primefactorsolutions/views/HoursWorkedMonthView.java deleted file mode 100644 index 88d86e6..0000000 --- a/src/main/java/com/primefactorsolutions/views/HoursWorkedMonthView.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.primefactorsolutions.views; - -import com.primefactorsolutions.model.Employee; -import com.primefactorsolutions.model.Actividad; -import com.primefactorsolutions.service.EmployeeService; -import com.vaadin.flow.component.button.Button; -import com.vaadin.flow.component.combobox.ComboBox; -import com.vaadin.flow.component.datepicker.DatePicker; -import com.vaadin.flow.component.grid.Grid; -import com.vaadin.flow.component.html.Label; -import com.vaadin.flow.component.notification.Notification; -import com.vaadin.flow.component.orderedlayout.HorizontalLayout; -import com.vaadin.flow.component.orderedlayout.VerticalLayout; -import com.vaadin.flow.router.PageTitle; -import com.vaadin.flow.router.Route; -import com.vaadin.flow.spring.annotation.SpringComponent; -import jakarta.annotation.security.PermitAll; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; - -import java.time.LocalDate; -import java.util.List; - -@SpringComponent -@PermitAll -@Scope("prototype") -@PageTitle("Hours Worked Month") -@Route(value = "/hours-worked-month/me", layout = MainLayout.class) -public class HoursWorkedMonthView extends VerticalLayout { - private final EmployeeService employeeService; - private final ComboBox employeeComboBox = new ComboBox<>("Empleado"); - private final ComboBox equipoDropdown = new ComboBox<>("Equipo"); - private final Grid grid = new Grid<>(Actividad.class); - - private final Label totalCompletadoLabel = new Label(); - private final Label horasPendientesLabel = new Label(); - private final Label totalAcumuladasLabel = new Label(); - private final Label horasAdeudadasLabel = new Label(); - private final Button actualizarButton = new Button("Actualizar"); - private final Button guardarButton = new Button("Guardar"); - private final Button cerrarButton = new Button("Cerrar"); - - private LocalDate selectedMonth; - - @Autowired - public HoursWorkedMonthView(final EmployeeService employeeService) { - this.employeeService = employeeService; - configurarVista(); - } - - private void configurarVista() { - DatePicker monthPicker = new DatePicker("Selecciona un mes"); - monthPicker.setValue(LocalDate.now()); - monthPicker.addValueChangeListener(event -> { - selectedMonth = event.getValue().withDayOfMonth(1); - //cargarDatosMes(selectedMonth); - }); - - equipoDropdown.setItems("Equipo 1", "Equipo 2", "Equipo 3"); - equipoDropdown.setWidth("250px"); - - setEmployeeComboBoxProperties(); - - configurarGrid(); - - actualizarButton.addClickListener(event -> actualizarDatos()); - guardarButton.addClickListener(event -> guardarActividades()); - cerrarButton.addClickListener(event -> closeView()); - - HorizontalLayout headerLayout = new HorizontalLayout(monthPicker, equipoDropdown, employeeComboBox); - add( - headerLayout, grid, totalCompletadoLabel, - horasPendientesLabel, totalAcumuladasLabel, - horasAdeudadasLabel, actualizarButton, - guardarButton, cerrarButton); - } - - private void setEmployeeComboBoxProperties() { - employeeComboBox.setWidth("250px"); - employeeComboBox.setPlaceholder("Buscar empleado..."); - employeeComboBox.setItems(employeeService.findAllEmployees()); - employeeComboBox.setItemLabelGenerator(employee -> employee.getFirstName() + " " + employee.getLastName()); - } - - private void configurarGrid() { - grid.removeAllColumns(); - grid.addColumn(Actividad::getLunes).setHeader("Lunes"); - grid.addColumn(Actividad::getMartes).setHeader("Martes"); - grid.addColumn(Actividad::getMiercoles).setHeader("Miércoles"); - grid.addColumn(Actividad::getJueves).setHeader("Jueves"); - grid.addColumn(Actividad::getViernes).setHeader("Viernes"); - grid.addColumn(Actividad::getSabado).setHeader("Sábado"); - grid.addColumn(Actividad::getDomingo).setHeader("Domingo"); - grid.addColumn(this::calcularTotalPorDia).setHeader("Total Semanal").setKey("totalSemanal"); - } - -// private void cargarDatosMes(final LocalDate month) { -// List actividadesDelMes = obtenerActividadesDelMes(month); -// grid.setItems(actividadesDelMes); -// -// double totalCompletado = calcularTotalCompletado(actividadesDelMes); -// double horasPendientes = calcularHorasPendientes(totalCompletado); -// double totalAcumuladas = 166; -// double horasAdeudadas = 2; -// -// totalCompletadoLabel.setText("Prom. Hrs/Semana Completadas: " + totalCompletado); -// horasPendientesLabel.setText("Prom. Hrs/Semana Pendientes: " + horasPendientes); -// totalAcumuladasLabel.setText("Total Hrs./Mes Acumuladas: " + totalAcumuladas); -// horasAdeudadasLabel.setText("Total Hrs./Mes Adeudadas: " + horasAdeudadas); -// } - -// private List obtenerActividadesDelMes(final LocalDate month) { -// LocalDate startOfMonth = month.with(TemporalAdjusters.firstDayOfMonth()); -// LocalDate endOfMonth = month.with(TemporalAdjusters.lastDayOfMonth()); -// -// List actividadesDelMes = new ArrayList<>(); -// -// for (LocalDate date = startOfMonth; date.isBefore(endOfMonth.plusDays(1)); date = date.plusDays(1)) { -// Actividad actividad = new Actividad.Builder() -// .lunes(0) -// .martes(0) -// .miercoles(0) -// .jueves(0) -// .viernes(0) -// .sabado(0) -// .domingo(0) -// .build(); -// actividadesDelMes.add(actividad); -// } -// -// return actividadesDelMes; -// } - - private double calcularTotalCompletado(final List actividades) { - return actividades.stream() - .mapToDouble(this::calcularTotalPorDia) - .sum(); - } - - private double calcularTotalPorDia(final Actividad actividad) { - return actividad.getLunes() + actividad.getMartes() + actividad.getMiercoles() - + actividad.getJueves() + actividad.getViernes() + actividad.getSabado() - + actividad.getDomingo(); - } - - private double calcularHorasPendientes(final double totalCompletado) { - return 40 - totalCompletado; - } - - private void actualizarDatos() { - Notification.show("Datos actualizados."); - } - - private void guardarActividades() { - Notification.show("Actividades guardadas correctamente."); - } - - private void closeView() { - getUI().ifPresent(ui -> ui.navigate("")); - } -} diff --git a/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java b/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java index 2c03fed..c325795 100644 --- a/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java +++ b/src/main/java/com/primefactorsolutions/views/HoursWorkedView.java @@ -52,9 +52,9 @@ public class HoursWorkedView extends BeanValidationForm implements private Button saveButton; - public HoursWorkedView(HoursWorkedService hoursWorkedService, - EmployeeService employeeService, - TeamService teamService) { + public HoursWorkedView(final HoursWorkedService hoursWorkedService, + final EmployeeService employeeService, + final TeamService teamService) { super(HoursWorked.class); this.hoursWorkedService = hoursWorkedService; this.employeeService = employeeService; @@ -68,7 +68,7 @@ public class HoursWorkedView extends BeanValidationForm implements } @Override - public void setParameter(BeforeEvent beforeEvent, final String action) { + public void setParameter(final BeforeEvent beforeEvent, final String action) { final RouteParameters params = beforeEvent.getRouteParameters(); final String s = params.get("hours-workedId").orElse(null); @@ -105,7 +105,8 @@ public class HoursWorkedView extends BeanValidationForm implements } private void configureTareasEspecificas() { - tareasEspecificasDropdown.setItems("Entrevistas", "Reuniones", "Colaboraciones", "Aprendizajes", "Proyectos PFS", "Otros"); + tareasEspecificasDropdown.setItems("Entrevistas", "Reuniones", + "Colaboraciones", "Aprendizajes", "Proyectos PFS", "Otros"); tareasEspecificasDropdown.setPlaceholder("Selecciona una tarea..."); tareasEspecificasDropdown.addValueChangeListener(event -> { @@ -187,7 +188,7 @@ public class HoursWorkedView extends BeanValidationForm implements } } - private void setFieldValues(HoursWorked hoursWorked) { + private void setFieldValues(final HoursWorked hoursWorked) { hoursWorked.setDate(dateField.getValue()); hoursWorked.setTeam(teamField.getValue()); hoursWorked.setEmployee(employeeField.getValue()); @@ -215,14 +216,17 @@ public class HoursWorkedView extends BeanValidationForm implements } private boolean isFormValid() { - return dateField.getValue() != null && - teamField.getValue() != null && - employeeField.getValue() != null && + return dateField.getValue() != null + && + teamField.getValue() != null + && + employeeField.getValue() != null + && !activityField.isEmpty(); } - private void configureViewOrEditAction(String action) { + private void configureViewOrEditAction(final String action) { if ("edit".equals(action) && hoursWorked != null) { setFieldsReadOnly(false); } else if ("view".equals(action) && hoursWorked != null) { @@ -231,7 +235,7 @@ public class HoursWorkedView extends BeanValidationForm implements } } - private void setFieldsReadOnly(boolean readOnly) { + private void setFieldsReadOnly(final boolean readOnly) { dateField.setReadOnly(readOnly); teamField.setReadOnly(readOnly); employeeField.setReadOnly(readOnly);