|
|
|
@ -22,12 +22,25 @@ public class RequirementFormValidator extends BaseValidator
|
|
|
|
|
public void validate(ValidationContext ctx)
|
|
|
|
|
{
|
|
|
|
|
Property propertyCentre = ctx.getProperties("centre")[0];
|
|
|
|
|
Workgroup workgroup = (Workgroup) propertyCentre.getValue();
|
|
|
|
|
|
|
|
|
|
if (workgroup == null)
|
|
|
|
|
{
|
|
|
|
|
this.errorMsg(ctx, StringUtils.localize("RequirementCenterIsEmpty"), "idReqCenter");
|
|
|
|
|
return;
|
|
|
|
|
if (propertyCentre != null) {
|
|
|
|
|
Workgroup workgroup = (Workgroup) propertyCentre.getValue();
|
|
|
|
|
|
|
|
|
|
if (workgroup == null) {
|
|
|
|
|
this.errorMsg(ctx, StringUtils.localize("RequirementCenterIsEmpty"), "idReqCenter");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Property propertyDescription = ctx.getProperties("description")[0];
|
|
|
|
|
|
|
|
|
|
if (propertyDescription != null) {
|
|
|
|
|
String description = (String) propertyDescription.getValue();
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNullOrTrimmedEmpty(description)) {
|
|
|
|
|
this.errorMsg(ctx, StringUtils.localize("ErrMaterialOrServiceDescription"), "idDescription");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|