Add start/end date constraints.
Update NEWS file. Resolve minor errors.
This commit is contained in:
parent
455c0f53b0
commit
fbdaf8f31f
7 changed files with 136 additions and 45 deletions
38
NEWS.rst
38
NEWS.rst
|
|
@ -93,6 +93,44 @@ Changes
|
||||||
* Code refactoring
|
* Code refactoring
|
||||||
|
|
||||||
|
|
||||||
|
Version 1.5.0 (? 2016)
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
Summary
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
|
* Bug fixing
|
||||||
|
* Email notification feature
|
||||||
|
* Risk and Issue Log feature
|
||||||
|
* Documents feature
|
||||||
|
* Global Dashboard feature
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Thanks to all the contributors to this new version:
|
||||||
|
|
||||||
|
* Jeroen Baten
|
||||||
|
* Vova Perebykivkyi
|
||||||
|
* Bodgan Bodnarjuk
|
||||||
|
* Misha Gozda
|
||||||
|
|
||||||
|
Changes
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
|
* Add Email notification feature (notification + template)
|
||||||
|
* Add new strings to i18n
|
||||||
|
* Add Risk&Issue Log feature
|
||||||
|
* Add Documents uploading/downloading feature
|
||||||
|
* Add test for documents feature
|
||||||
|
* Changes to LibrePlan version check
|
||||||
|
* Add Global Dashboard page
|
||||||
|
|
||||||
|
* Update MPXJ library
|
||||||
|
|
||||||
|
* Code refactoring
|
||||||
|
|
||||||
|
|
||||||
Version 1.4.2 (2015)
|
Version 1.4.2 (2015)
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,7 @@
|
||||||
<addColumn tableName="configuration">
|
<addColumn tableName="configuration">
|
||||||
<column name="automatic_budget_enabled" type="BOOLEAN" />
|
<column name="automatic_budget_enabled" type="BOOLEAN" />
|
||||||
</addColumn>
|
</addColumn>
|
||||||
<addDefaultValue tableName="configuration" columnName="automatic_budget_enabled"
|
<addDefaultValue tableName="configuration" columnName="automatic_budget_enabled" defaultValueBoolean="FALSE" />
|
||||||
defaultValueBoolean="FALSE" />
|
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
<changeSet id="add-automatic_budget_type_of_work_hours-to-configuration" author="ltilve">
|
<changeSet id="add-automatic_budget_type_of_work_hours-to-configuration" author="ltilve">
|
||||||
|
|
@ -43,7 +42,7 @@
|
||||||
|
|
||||||
<changeSet id="adding-limits" author="vova/jeroen">
|
<changeSet id="adding-limits" author="vova/jeroen">
|
||||||
<createTable tableName="limits">
|
<createTable tableName="limits">
|
||||||
<column name="id" type="BIGINT" autoIncrement="true">
|
<column name="id" type="BIGINT">
|
||||||
<constraints primaryKey="true" nullable="false" primaryKeyName="limits_pkey"/>
|
<constraints primaryKey="true" nullable="false" primaryKeyName="limits_pkey"/>
|
||||||
</column>
|
</column>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||||
|
|
||||||
<hibernate-mapping package="org.libreplan.business.email.entities" default-access="field">
|
<hibernate-mapping package="org.libreplan.business.common.entities" default-access="field">
|
||||||
|
|
||||||
<class name="org.libreplan.business.common.entities.Limits" abstract="true" table="limits">
|
<class name="Limits" abstract="true" table="limits">
|
||||||
|
|
||||||
<id name="id" access="property" type="long">
|
<id name="id" access="property" type="long">
|
||||||
<generator class="increment" >
|
<generator class="increment" >
|
||||||
|
|
|
||||||
|
|
@ -24,25 +24,33 @@ package org.libreplan.web.orders;
|
||||||
import org.libreplan.business.orders.entities.OrderElement;
|
import org.libreplan.business.orders.entities.OrderElement;
|
||||||
import org.libreplan.web.common.Util;
|
import org.libreplan.web.common.Util;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.WrongValueException;
|
||||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||||
|
import org.zkoss.zul.Constraint;
|
||||||
import org.zkoss.zul.api.Datebox;
|
import org.zkoss.zul.api.Datebox;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static org.libreplan.web.I18nHelper._;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller for {@link OrderElement} details
|
* Controller for {@link OrderElement} details.
|
||||||
*
|
*
|
||||||
* @author Diego Pino García <dpino@igalia.com>
|
* @author Diego Pino García <dpino@igalia.com>
|
||||||
*
|
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
|
||||||
*/
|
*/
|
||||||
public class DetailsOrderElementController extends
|
public class DetailsOrderElementController extends GenericForwardComposer {
|
||||||
GenericForwardComposer {
|
|
||||||
|
|
||||||
private IOrderElementModel orderElementModel;
|
private IOrderElementModel orderElementModel;
|
||||||
|
|
||||||
|
private Datebox initDate;
|
||||||
|
|
||||||
private Datebox deadline;
|
private Datebox deadline;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
// TODO resolve deprecated
|
||||||
comp.setVariable("detailsController", this, true);
|
comp.setVariable("detailsController", this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,10 +97,45 @@ public class DetailsOrderElementController extends
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
OrderElement orderElement = orderElementModel.getOrderElement();
|
OrderElement orderElement = orderElementModel.getOrderElement();
|
||||||
if (orderElement == null) {
|
|
||||||
return false;
|
return orderElement != null && orderElement.isJiraIssue();
|
||||||
}
|
}
|
||||||
return orderElement.isJiraIssue();
|
|
||||||
|
public Constraint checkConstraintStartDate() {
|
||||||
|
return new Constraint() {
|
||||||
|
@Override
|
||||||
|
public void validate(Component comp, Object value) throws WrongValueException {
|
||||||
|
Date startDate = (Date) value;
|
||||||
|
Date year2010 = new Date(1262296800000L);
|
||||||
|
|
||||||
|
boolean startBefore2010 = (startDate != null) && startDate.before(year2010);
|
||||||
|
|
||||||
|
if ( startBefore2010 ) {
|
||||||
|
initDate.setValue(null);
|
||||||
|
getOrderElement().setInitDate(null);
|
||||||
|
throw new WrongValueException(comp, _("Must be after 2010!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Constraint checkConstraintFinishDate() {
|
||||||
|
return new Constraint() {
|
||||||
|
@Override
|
||||||
|
public void validate(Component comp, Object value) throws WrongValueException {
|
||||||
|
Date finishDate = (Date) value;
|
||||||
|
|
||||||
|
boolean deadlineBeforeStart = (finishDate != null) &&
|
||||||
|
(initDate.getValue() != null) &&
|
||||||
|
(finishDate.compareTo(initDate.getValue()) < 0);
|
||||||
|
|
||||||
|
if ( deadlineBeforeStart ) {
|
||||||
|
deadline.setValue(null);
|
||||||
|
getOrderElement().setDeadline(null);
|
||||||
|
throw new WrongValueException(comp, _("must be after starting date"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -27,8 +27,6 @@ import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.libreplan.business.calendars.entities.BaseCalendar;
|
import org.libreplan.business.calendars.entities.BaseCalendar;
|
||||||
import org.libreplan.business.externalcompanies.entities.ExternalCompany;
|
import org.libreplan.business.externalcompanies.entities.ExternalCompany;
|
||||||
|
|
@ -38,7 +36,6 @@ import org.libreplan.business.templates.entities.OrderTemplate;
|
||||||
import org.libreplan.web.common.ConstraintChecker;
|
import org.libreplan.web.common.ConstraintChecker;
|
||||||
import org.libreplan.web.common.Util;
|
import org.libreplan.web.common.Util;
|
||||||
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
|
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
|
||||||
import org.libreplan.web.planner.consolidations.AdvanceConsolidationController;
|
|
||||||
import org.libreplan.web.planner.tabs.MultipleTabsPlannerController;
|
import org.libreplan.web.planner.tabs.MultipleTabsPlannerController;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
|
|
@ -56,17 +53,15 @@ import org.zkoss.zul.Textbox;
|
||||||
import org.zkoss.zul.Window;
|
import org.zkoss.zul.Window;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller for the creation of an {@link order} with its principal
|
* Controller for the creation of an {@link Order} with its principal properties.
|
||||||
* properties.
|
|
||||||
*
|
*
|
||||||
* @author Susana Montes Pedreira <smontes@wirelessgailicia.com>
|
* @author Susana Montes Pedreira <smontes@wirelessgailicia.com>
|
||||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||||
|
* @author Vova Perebykivskyi <vova@libreplan-enterprise.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ProjectDetailsController extends GenericForwardComposer {
|
public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(AdvanceConsolidationController.class);
|
|
||||||
|
|
||||||
private OrderCRUDController orderController;
|
private OrderCRUDController orderController;
|
||||||
|
|
||||||
private Grid gridProjectDetails;
|
private Grid gridProjectDetails;
|
||||||
|
|
@ -96,8 +91,8 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
|
|
||||||
public ProjectDetailsController() {
|
public ProjectDetailsController() {
|
||||||
|
|
||||||
Window window = (Window) Executions.createComponents("/orders/_projectDetails.zul", null,
|
Window window = (Window)
|
||||||
new HashMap<String, String>());
|
Executions.createComponents("/orders/_projectDetails.zul", null, new HashMap<String, String>());
|
||||||
try {
|
try {
|
||||||
doAfterCompose(window);
|
doAfterCompose(window);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -109,6 +104,7 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
window = (Window) comp;
|
window = (Window) comp;
|
||||||
|
// TODO resolve deprecated
|
||||||
window.setVariable("projectController", this, true);
|
window.setVariable("projectController", this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,9 +118,7 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
Util.createBindingsFor(gridProjectDetails);
|
Util.createBindingsFor(gridProjectDetails);
|
||||||
Util.reloadBindings(gridProjectDetails);
|
Util.reloadBindings(gridProjectDetails);
|
||||||
window.doModal();
|
window.doModal();
|
||||||
} catch (SuspendNotAllowedException e) {
|
} catch (SuspendNotAllowedException | InterruptedException e) {
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -170,8 +164,7 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showWrongName() {
|
private void showWrongName() {
|
||||||
throw new WrongValueException(txtName,
|
throw new WrongValueException(txtName, _("project name already being used"));
|
||||||
_("project name already being used"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void close() {
|
private void close() {
|
||||||
|
|
@ -210,8 +203,8 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
private void clearProperties() {
|
private void clearProperties() {
|
||||||
Order order = orderController.getOrder();
|
Order order = orderController.getOrder();
|
||||||
order.setName(null);
|
order.setName(null);
|
||||||
// reset the code autogenerated property
|
/* Reset the code autogenerated property */
|
||||||
if (isCodeAutogeneratedInit) {
|
if ( isCodeAutogeneratedInit ) {
|
||||||
order.setCodeAutogenerated(true);
|
order.setCodeAutogenerated(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -227,15 +220,17 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
public Constraint checkConstraintFinishDate() {
|
public Constraint checkConstraintFinishDate() {
|
||||||
return new Constraint() {
|
return new Constraint() {
|
||||||
@Override
|
@Override
|
||||||
public void validate(Component comp, Object value)
|
public void validate(Component comp, Object value) throws WrongValueException {
|
||||||
throws WrongValueException {
|
|
||||||
Date finishDate = (Date) value;
|
Date finishDate = (Date) value;
|
||||||
if ((finishDate != null) && (initDate.getValue() != null)
|
|
||||||
&& (finishDate.compareTo(initDate.getValue()) < 0)) {
|
boolean deadlineBeforeStart = (finishDate != null) &&
|
||||||
|
(initDate.getValue() != null) &&
|
||||||
|
(finishDate.compareTo(initDate.getValue()) < 0);
|
||||||
|
|
||||||
|
if ( deadlineBeforeStart ) {
|
||||||
deadline.setValue(null);
|
deadline.setValue(null);
|
||||||
getOrder().setDeadline(null);
|
getOrder().setDeadline(null);
|
||||||
throw new WrongValueException(comp,
|
throw new WrongValueException(comp, _("must be after start date"));
|
||||||
_("must be after start date"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -244,15 +239,26 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
||||||
public Constraint checkConstraintStartDate() {
|
public Constraint checkConstraintStartDate() {
|
||||||
return new Constraint() {
|
return new Constraint() {
|
||||||
@Override
|
@Override
|
||||||
public void validate(Component comp, Object value)
|
public void validate(Component comp, Object value) throws WrongValueException {
|
||||||
throws WrongValueException {
|
|
||||||
Date startDate = (Date) value;
|
Date startDate = (Date) value;
|
||||||
if ((startDate != null) && (deadline.getValue() != null)
|
|
||||||
&& (startDate.compareTo(deadline.getValue()) > 0)) {
|
boolean startAfterDeadline = (startDate != null) &&
|
||||||
|
(deadline.getValue() != null) &&
|
||||||
|
(startDate.compareTo(deadline.getValue()) > 0);
|
||||||
|
|
||||||
|
if ( startAfterDeadline ) {
|
||||||
initDate.setValue(null);
|
initDate.setValue(null);
|
||||||
getOrder().setInitDate(null);
|
getOrder().setInitDate(null);
|
||||||
throw new WrongValueException(comp,
|
throw new WrongValueException(comp, _("must be lower than end date"));
|
||||||
_("must be lower than end date"));
|
}
|
||||||
|
|
||||||
|
Date year2010 = new Date(1262296800000L);
|
||||||
|
boolean startBefore2010 = (startDate != null) && startDate.before(year2010);
|
||||||
|
|
||||||
|
if ( startBefore2010 ) {
|
||||||
|
initDate.setValue(null);
|
||||||
|
getOrder().setInitDate(null);
|
||||||
|
throw new WrongValueException(comp, _("Must be after 2010!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9411,8 +9411,11 @@ msgstr ""
|
||||||
msgid "Email: timesheet data missing"
|
msgid "Email: timesheet data missing"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#: libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java:804
|
#: libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java:804
|
||||||
msgid "You cannot email user twice with the same info"
|
msgid "You cannot email user twice with the same info"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: libreplan-webapp/src/main/java/org/libreplan/web/orders/ProjectDetailsController.java:266
|
||||||
|
#: libreplan-webapp/src/main/java/org/libreplan/web/orders/DetailsOrderElement.java:110
|
||||||
|
msgid "Must be after 2010!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
@ -45,14 +45,16 @@
|
||||||
<label value="${i18n:_('Starting date')}" />
|
<label value="${i18n:_('Starting date')}" />
|
||||||
<hbox>
|
<hbox>
|
||||||
<datebox id="initDate"
|
<datebox id="initDate"
|
||||||
value="@{detailsController.orderElement.initDate}" />
|
value="@{detailsController.orderElement.initDate}"
|
||||||
|
constraint="@{detailsController.checkConstraintStartDate}"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<label value="${i18n:_('Deadline')}" />
|
<label value="${i18n:_('Deadline')}" />
|
||||||
<hbox>
|
<hbox>
|
||||||
<datebox id="deadline"
|
<datebox id="deadline"
|
||||||
value="@{detailsController.orderElement.deadline}" />
|
value="@{detailsController.orderElement.deadline}"
|
||||||
|
constraint="@{detailsController.checkConstraintFinishDate}"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue