diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationCRUDController.java index 1f5331211..ceab87024 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationCRUDController.java @@ -88,15 +88,15 @@ public class CustomerComunicationCRUDController extends GenericForwardComposer { } } - public FilterCustomerComunicationEnum[] getFilterItems(){ - return FilterCustomerComunicationEnum.values(); + public FilterComunicationEnum[] getFilterItems(){ + return FilterComunicationEnum.values(); } - public FilterCustomerComunicationEnum getCurrentFilterItem() { + public FilterComunicationEnum getCurrentFilterItem() { return customerComunicationModel.getCurrentFilter(); } - public void setCurrentFilterItem(FilterCustomerComunicationEnum selected) { + public void setCurrentFilterItem(FilterComunicationEnum selected) { customerComunicationModel.setCurrentFilter(selected); // update the customer comunication list @@ -110,7 +110,7 @@ public class CustomerComunicationCRUDController extends GenericForwardComposer { } public List getCustomerComunications() { - FilterCustomerComunicationEnum currentFilter = customerComunicationModel.getCurrentFilter(); + FilterComunicationEnum currentFilter = customerComunicationModel.getCurrentFilter(); switch(currentFilter){ case ALL: return customerComunicationModel.getCustomerAllComunications(); case NOT_REVIEWED: return customerComunicationModel.getCustomerComunicationWithoutReviewed(); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationModel.java index bc8f6ede9..c0423d6a2 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/CustomerComunicationModel.java @@ -1,3 +1,24 @@ +/* + * This file is part of LibrePlan + * + * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e + * Desenvolvemento Tecnolóxico de Galicia + * Copyright (C) 2010-2011 Igalia, S.L. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + package org.libreplan.web.subcontract; import java.util.List; @@ -19,7 +40,7 @@ public class CustomerComunicationModel implements ICustomerComunicationModel{ @Autowired private ICustomerComunicationDAO customerComunicationDAO; - private FilterCustomerComunicationEnum currentFilter = FilterCustomerComunicationEnum.NOT_REVIEWED; + private FilterComunicationEnum currentFilter = FilterComunicationEnum.NOT_REVIEWED; @Override @Transactional @@ -31,7 +52,7 @@ public class CustomerComunicationModel implements ICustomerComunicationModel{ @Transactional public List getCustomerAllComunications(){ List list = customerComunicationDAO.getAll(); - forceLoadAssociatedOrder(list); + forceLoadAssociatedData(list); return list; } @@ -39,11 +60,11 @@ public class CustomerComunicationModel implements ICustomerComunicationModel{ @Transactional public List getCustomerComunicationWithoutReviewed(){ List list = customerComunicationDAO.getAllNotReviewed(); - forceLoadAssociatedOrder(list); + forceLoadAssociatedData(list); return list; } - private void forceLoadAssociatedOrder(List customerComunicationList){ + private void forceLoadAssociatedData(List customerComunicationList){ if (customerComunicationList != null) { for (CustomerComunication customerComunication : customerComunicationList) { customerComunication.getOrder().getName(); @@ -52,12 +73,12 @@ public class CustomerComunicationModel implements ICustomerComunicationModel{ } @Override - public void setCurrentFilter(FilterCustomerComunicationEnum currentFilter) { + public void setCurrentFilter(FilterComunicationEnum currentFilter) { this.currentFilter = currentFilter; } @Override - public FilterCustomerComunicationEnum getCurrentFilter() { + public FilterComunicationEnum getCurrentFilter() { return currentFilter; } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/FilterCustomerComunicationEnum.java b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/FilterComunicationEnum.java similarity index 88% rename from libreplan-webapp/src/main/java/org/libreplan/web/subcontract/FilterCustomerComunicationEnum.java rename to libreplan-webapp/src/main/java/org/libreplan/web/subcontract/FilterComunicationEnum.java index 89681f5fe..cdd323696 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/FilterCustomerComunicationEnum.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/FilterComunicationEnum.java @@ -26,7 +26,7 @@ package org.libreplan.web.subcontract; * * @author Susana Montes Pedreira */ - public enum FilterCustomerComunicationEnum { + public enum FilterComunicationEnum { ALL(_("All")), NOT_REVIEWED(_("Not Reviewed")); @@ -39,11 +39,11 @@ package org.libreplan.web.subcontract; private String displayName; - private FilterCustomerComunicationEnum(String displayName) { + private FilterComunicationEnum(String displayName) { this.displayName = displayName; } - public static FilterCustomerComunicationEnum getDefault() { + public static FilterComunicationEnum getDefault() { return ALL; } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/ICustomerComunicationModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/ICustomerComunicationModel.java index a80cdbf20..a6ecdd3d0 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/ICustomerComunicationModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/subcontract/ICustomerComunicationModel.java @@ -1,3 +1,24 @@ +/* + * This file is part of LibrePlan + * + * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e + * Desenvolvemento Tecnolóxico de Galicia + * Copyright (C) 2010-2011 Igalia, S.L. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + package org.libreplan.web.subcontract; import java.util.List; @@ -12,8 +33,8 @@ public interface ICustomerComunicationModel { List getCustomerAllComunications(); - void setCurrentFilter(FilterCustomerComunicationEnum currentFilter); + void setCurrentFilter(FilterComunicationEnum currentFilter); - FilterCustomerComunicationEnum getCurrentFilter(); + FilterComunicationEnum getCurrentFilter(); }