[Bug #797] checks out if obligatory data are introduced to create a new project.
FEA : ItEr68S04BugFixing
This commit is contained in:
parent
789734c3e3
commit
23fd066194
2 changed files with 26 additions and 6 deletions
|
|
@ -30,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
||||
import org.navalplanner.business.externalcompanies.entities.ExternalCompany;
|
||||
import org.navalplanner.business.orders.entities.Order;
|
||||
import org.navalplanner.web.common.ConstraintChecker;
|
||||
import org.navalplanner.web.common.Util;
|
||||
import org.navalplanner.web.planner.consolidations.AdvanceConsolidationController;
|
||||
import org.navalplanner.web.planner.tabs.MultipleTabsPlannerController;
|
||||
|
|
@ -117,11 +118,28 @@ public class ProjectDetailsController extends GenericForwardComposer {
|
|||
}
|
||||
|
||||
public void accept() {
|
||||
if (tabs != null) {
|
||||
tabs.goToOrdersList();
|
||||
if (validate()) {
|
||||
if (tabs != null) {
|
||||
tabs.goToOrdersList();
|
||||
}
|
||||
orderController.editNewCreatedOrder();
|
||||
close();
|
||||
}
|
||||
orderController.editNewCreatedOrder();
|
||||
close();
|
||||
}
|
||||
|
||||
private boolean validate() {
|
||||
if (!ConstraintChecker.isValid(window)) {
|
||||
return false;
|
||||
}
|
||||
if (initDate.getValue() == null) {
|
||||
showWrongValue();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void showWrongValue() {
|
||||
throw new WrongValueException(initDate, _("cannot be null or empty"));
|
||||
}
|
||||
|
||||
private void close() {
|
||||
|
|
|
|||
|
|
@ -33,13 +33,15 @@
|
|||
<rows>
|
||||
<row>
|
||||
<label value="${i18n:_('Name')}" />
|
||||
<textbox value="@{projectController.order.name}" width="500px"/>
|
||||
<textbox value="@{projectController.order.name}" width="500px"
|
||||
constraint="no empty:${i18n:_('cannot be null or empty')}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Code')}" />
|
||||
<hbox>
|
||||
<textbox id="txtCode" value="@{projectController.order.code}" width="250px"
|
||||
disabled="@{projectController.codeAutogenerated}" />
|
||||
disabled="@{projectController.codeAutogenerated}"
|
||||
constraint="no empty:${i18n:_('cannot be null or empty')}"/>
|
||||
<checkbox label="${i18n:_('Autogenerated')}"
|
||||
checked="@{projectController.codeAutogenerated}"/>
|
||||
</hbox>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue