|
|
|
@ -1,13 +1,7 @@
|
|
|
|
|
package info.bukova.isspst.ui.requirement;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import org.zkoss.bind.annotation.BindingParam;
|
|
|
|
|
import org.zkoss.bind.annotation.Command;
|
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
|
import org.zkoss.bind.annotation.NotifyChange;
|
|
|
|
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|
|
|
|
|
|
|
|
|
import info.bukova.isspst.StringUtils;
|
|
|
|
|
import info.bukova.isspst.data.RequirementState;
|
|
|
|
|
import info.bukova.isspst.data.SettingsData;
|
|
|
|
|
import info.bukova.isspst.data.TripRequirement;
|
|
|
|
|
import info.bukova.isspst.data.User;
|
|
|
|
@ -19,6 +13,17 @@ import info.bukova.isspst.services.users.UserService;
|
|
|
|
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
|
|
|
|
import info.bukova.isspst.ui.FormViewModel;
|
|
|
|
|
import info.bukova.isspst.validators.TripRequirementFormValidator;
|
|
|
|
|
import org.zkoss.bind.annotation.BindingParam;
|
|
|
|
|
import org.zkoss.bind.annotation.Command;
|
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
|
import org.zkoss.bind.annotation.NotifyChange;
|
|
|
|
|
import org.zkoss.zk.ui.event.Event;
|
|
|
|
|
import org.zkoss.zk.ui.event.EventListener;
|
|
|
|
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|
|
|
|
import org.zkoss.zul.Messagebox;
|
|
|
|
|
import org.zkoss.zul.Window;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class TripRequirementForm extends FormViewModel<TripRequirement> {
|
|
|
|
|
|
|
|
|
@ -33,6 +38,30 @@ public class TripRequirementForm extends FormViewModel<TripRequirement> {
|
|
|
|
|
@WireVariable
|
|
|
|
|
private TripRequirementService tripRequirementService;
|
|
|
|
|
private List<Workgroup> centres;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@NotifyChange("errMessages")
|
|
|
|
|
@Command
|
|
|
|
|
public void save(@BindingParam("window") Window win) {
|
|
|
|
|
final Window editWin = win;
|
|
|
|
|
|
|
|
|
|
if (getDataBean().getState() == RequirementState.APPROVED) {
|
|
|
|
|
Messagebox.show(StringUtils.localize("TripRequirementChangeWarn"), StringUtils.localize("TripRequirementSave"), Messagebox.YES
|
|
|
|
|
| Messagebox.NO, Messagebox.QUESTION, new EventListener<Event>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onEvent(Event event) throws Exception {
|
|
|
|
|
if (((Integer) event.getData()).intValue() == Messagebox.YES) {
|
|
|
|
|
TripRequirementForm.super.save(editWin);
|
|
|
|
|
} else {
|
|
|
|
|
editWin.detach();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
super.save(win);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<User> users;
|
|
|
|
|
private List<User> passengers;
|
|
|
|
|
private User selUser;
|
|
|
|
|