|
|
@ -1,5 +1,7 @@
|
|
|
|
package info.bukova.isspst.ui.requirement;
|
|
|
|
package info.bukova.isspst.ui.requirement;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import info.bukova.isspst.StringUtils;
|
|
|
|
|
|
|
|
import info.bukova.isspst.data.RequirementState;
|
|
|
|
import info.bukova.isspst.data.SettingsData;
|
|
|
|
import info.bukova.isspst.data.SettingsData;
|
|
|
|
import info.bukova.isspst.data.TripRequirement;
|
|
|
|
import info.bukova.isspst.data.TripRequirement;
|
|
|
|
import info.bukova.isspst.data.User;
|
|
|
|
import info.bukova.isspst.data.User;
|
|
|
@ -16,11 +18,15 @@ import org.zkoss.bind.annotation.BindingParam;
|
|
|
|
import org.zkoss.bind.annotation.Command;
|
|
|
|
import org.zkoss.bind.annotation.Command;
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
import org.zkoss.bind.annotation.NotifyChange;
|
|
|
|
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.zk.ui.select.annotation.WireVariable;
|
|
|
|
|
|
|
|
import org.zkoss.zul.Messagebox;
|
|
|
|
|
|
|
|
import org.zkoss.zul.Window;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
public class TripRequirementForm extends FormWithUpload<TripRequirement> {
|
|
|
|
public class TripRequirementForm extends FormViewModel<TripRequirement> {
|
|
|
|
|
|
|
|
|
|
|
|
@WireVariable
|
|
|
|
@WireVariable
|
|
|
|
private UserService userService;
|
|
|
|
private UserService userService;
|
|
|
@ -35,6 +41,30 @@ public class TripRequirementForm extends FormWithUpload<TripRequirement> {
|
|
|
|
@WireVariable
|
|
|
|
@WireVariable
|
|
|
|
private DocumentFileStorage documentStorage;
|
|
|
|
private DocumentFileStorage documentStorage;
|
|
|
|
private List<Workgroup> centres;
|
|
|
|
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> users;
|
|
|
|
private List<User> passengers;
|
|
|
|
private List<User> passengers;
|
|
|
|
private User selUser;
|
|
|
|
private User selUser;
|
|
|
|