Opravena editace existujících položek požadavků

multitenant
Josef Rokos 10 years ago
parent 5fd9f1844b
commit 372814e4b3

@ -21,7 +21,7 @@ public class RequirementTypeServiceImpl extends AbstractOwnedService<Requiremen
public List<Workgroup> filterCentres(RequirementType reqType,
List<Workgroup> source) {
if (!reqType.getLimitCentres()) {
if (reqType.getLimitCentres() == null || !reqType.getLimitCentres()) {
return source;
}

@ -5,6 +5,7 @@ import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.RequirementItem;
import info.bukova.isspst.data.RequirementSubject;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.requirement.RequirementTypeService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
@ -40,6 +41,9 @@ public class RequirementForm extends FormViewModel<Requirement>
@WireVariable
private RequirementTypeService reqTypeService;
@WireVariable
private RequirementService requirementService;
private RequirementItem selectedItem;
@ -105,6 +109,7 @@ public class RequirementForm extends FormViewModel<Requirement>
this.setBigDecimalConverter(new BigDecimalConverter());
this.setRequirementFormValidator(new RequirementFormValidator());
this.setSyncItems(this.getDataBean().getItems());
requirementService.loadType(getDataBean());
this.centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent()));
}

@ -13,6 +13,7 @@ import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.requirement.RequirementTypeService;
import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
@ -29,6 +30,8 @@ public class TripRequirementForm extends FormViewModel<TripRequirement> {
private GlobalSettingsService settingsService;
@WireVariable
private RequirementTypeService reqTypeService;
@WireVariable
private TripRequirementService tripRequirementService;
private List<Workgroup> centres;
private List<User> users;
private List<User> passengers;
@ -37,6 +40,7 @@ public class TripRequirementForm extends FormViewModel<TripRequirement> {
@Init(superclass = true)
public void init() {
tripRequirementService.loadType(getDataBean());
centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent()));
users = userService.getAll();
passengers = getDataBean().getPassengers();

Loading…
Cancel
Save