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, public List<Workgroup> filterCentres(RequirementType reqType,
List<Workgroup> source) { List<Workgroup> source) {
if (!reqType.getLimitCentres()) { if (reqType.getLimitCentres() == null || !reqType.getLimitCentres()) {
return source; return source;
} }

@ -5,6 +5,7 @@ import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.RequirementItem; import info.bukova.isspst.data.RequirementItem;
import info.bukova.isspst.data.RequirementSubject; import info.bukova.isspst.data.RequirementSubject;
import info.bukova.isspst.data.Workgroup; 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.requirement.RequirementTypeService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
@ -41,6 +42,9 @@ public class RequirementForm extends FormViewModel<Requirement>
@WireVariable @WireVariable
private RequirementTypeService reqTypeService; private RequirementTypeService reqTypeService;
@WireVariable
private RequirementService requirementService;
private RequirementItem selectedItem; private RequirementItem selectedItem;
private int selItemIndex; private int selItemIndex;
@ -105,6 +109,7 @@ public class RequirementForm extends FormViewModel<Requirement>
this.setBigDecimalConverter(new BigDecimalConverter()); this.setBigDecimalConverter(new BigDecimalConverter());
this.setRequirementFormValidator(new RequirementFormValidator()); this.setRequirementFormValidator(new RequirementFormValidator());
this.setSyncItems(this.getDataBean().getItems()); this.setSyncItems(this.getDataBean().getItems());
requirementService.loadType(getDataBean());
this.centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent())); 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.User;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.requirement.RequirementTypeService; 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.settings.GlobalSettingsService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
@ -29,6 +30,8 @@ public class TripRequirementForm extends FormViewModel<TripRequirement> {
private GlobalSettingsService settingsService; private GlobalSettingsService settingsService;
@WireVariable @WireVariable
private RequirementTypeService reqTypeService; private RequirementTypeService reqTypeService;
@WireVariable
private TripRequirementService tripRequirementService;
private List<Workgroup> centres; private List<Workgroup> centres;
private List<User> users; private List<User> users;
private List<User> passengers; private List<User> passengers;
@ -37,6 +40,7 @@ public class TripRequirementForm extends FormViewModel<TripRequirement> {
@Init(superclass = true) @Init(superclass = true)
public void init() { public void init() {
tripRequirementService.loadType(getDataBean());
centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent())); centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent()));
users = userService.getAll(); users = userService.getAll();
passengers = getDataBean().getPassengers(); passengers = getDataBean().getPassengers();

Loading…
Cancel
Save