From aa7f135b0e93212ef9c8cadf90aa68e2e72c48c0 Mon Sep 17 00:00:00 2001 From: Vova Perebykivskiy Date: Fri, 4 Dec 2015 14:44:34 +0200 Subject: [PATCH 1/2] Fix merge conflicts. --- .../src/main/resources/db.changelog-1.5.xml | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/libreplan-business/src/main/resources/db.changelog-1.5.xml b/libreplan-business/src/main/resources/db.changelog-1.5.xml index 32ab6d30c..f969c70b6 100644 --- a/libreplan-business/src/main/resources/db.changelog-1.5.xml +++ b/libreplan-business/src/main/resources/db.changelog-1.5.xml @@ -1,28 +1,54 @@ - + + - + + + + + + + + - + + + + + + + + + + + + + + \ No newline at end of file From 6aaae08f42255a039b1935c975130d49ae9678a2 Mon Sep 17 00:00:00 2001 From: Vova Perebykivskiy Date: Thu, 3 Dec 2015 16:49:54 +0200 Subject: [PATCH 2/2] Add Liquibase 1.5 changelog to changelogs. Fix compile errors. Code refactoring. --- .../libreplan-business-spring-config-test.xml | 3 ++ .../dashboard/DashboardControllerGlobal.java | 28 ++----------------- .../taskedition/TaskPropertiesController.java | 2 +- .../libreplan-webapp-spring-config-test.xml | 3 ++ 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/libreplan-business/src/test/resources/libreplan-business-spring-config-test.xml b/libreplan-business/src/test/resources/libreplan-business-spring-config-test.xml index 32ad8eb9c..fa7a5ee8b 100644 --- a/libreplan-business/src/test/resources/libreplan-business-spring-config-test.xml +++ b/libreplan-business/src/test/resources/libreplan-business-spring-config-test.xml @@ -40,6 +40,9 @@ org/libreplan/business/orders/entities/Orders.hbm.xml + + org/libreplan/business/templates/entities/Templates.hbm.xml + org/libreplan/business/planner/entities/Tasks.hbm.xml diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardControllerGlobal.java b/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardControllerGlobal.java index 71d9c793b..3c2230122 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardControllerGlobal.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardControllerGlobal.java @@ -231,34 +231,12 @@ public class DashboardControllerGlobal extends GenericForwardComposer { } } + // Remove time, timezone from full-date string private String getOrderInitDate(Order order) throws ParseException { - // Remove time, timezone from full-date string - DateFormat inputFormatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); - DateFormat outputFormatter = new SimpleDateFormat("EEE MMM dd yyyy"); - String input = ""; - String outputInit = ""; - String outputDeadline = ""; - Date date = null; - - input = order.getInitDate().toString(); - date = inputFormatter.parse(input); - - return outputInit = outputFormatter.format(date); + return new SimpleDateFormat("EEE MMM dd yyyy").format(order.getInitDate()); } - private String getOrderDeadline(Order order) throws ParseException { - // Remove time, timezone from full-date string - DateFormat inputFormatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); - DateFormat outputFormatter = new SimpleDateFormat("EEE MMM dd yyyy"); - String input = ""; - String outputInit = ""; - String outputDeadline = ""; - Date date = null; - - input = order.getDeadline().toString(); - date = inputFormatter.parse(input); - - return outputDeadline = outputFormatter.format(date); + return new SimpleDateFormat("EEE MMM dd yyyy").format(order.getDeadline()); } public void showStoredColumn() throws ParseException { diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java index 4934390af..e6495d518 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java @@ -732,7 +732,7 @@ public class TaskPropertiesController extends GenericForwardComposer { private void EmailNotificationAddNewWithTaskAssignedToResource(){ - if ( allocationResult != null ) { + if ( allocationResult.getSpecificAllocations().size() != 0 ) { /* Check if resources in allocation are bound by user and are in role ROLE_EMAIL_TASK_ASSIGNED_TO_RESOURCE * setUser method calling manually because, after initialization user will be null diff --git a/libreplan-webapp/src/test/resources/libreplan-webapp-spring-config-test.xml b/libreplan-webapp/src/test/resources/libreplan-webapp-spring-config-test.xml index 1dd57d780..5a41f4130 100644 --- a/libreplan-webapp/src/test/resources/libreplan-webapp-spring-config-test.xml +++ b/libreplan-webapp/src/test/resources/libreplan-webapp-spring-config-test.xml @@ -41,6 +41,9 @@ org/libreplan/business/orders/entities/Orders.hbm.xml + + org/libreplan/business/templates/entities/Templates.hbm.xml + org/libreplan/business/planner/entities/Tasks.hbm.xml