47 boolean canGetIn =
true;
49 Rows rows = getRows();
51 rows.getChildren().clear();
57 TimeControlUtil tcu =
new TimeControlUtil();
58 tcu.setHumanResource(humanResource);
59 List<TimeControl> pending = tcu.getPendingControl();
61 for(TimeControl tc : pending) {
62 final Row row =
new Row();
64 rows.appendChild(row);
66 row.appendChild(
new LabelExtended().setDateTime(tc.getStartTime()));
68 if(tc.getTask() !=
null) {
69 row.appendChild(
new Label(tc.getTask().getFullDescription()));
71 row.appendChild(
new Space());
75 Button select =
new Button(tc.getTask() ==
null ? Application.getString(
"lGetOut") : Application.getString(
"lFinalize") +
" " +Application.getString(
"lTask"));
76 select.setHflex(
"true");
77 select.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
79 public void onEvent(Event event) throws Exception {
80 Events.postEvent(new Event(Events.ON_CHANGE, TaskSelector.this, row.getValue()));
83 row.appendChild(select);
87 final Row rowStart =
new Row();
88 rows.appendChild(rowStart);
90 rowStart.appendChild(
new Label(Application.getString(
"lNow")));
92 rowStart.appendChild(
new Space());
94 Button butStart =
new Button(Application.getString(
"lGetIn"));
95 butStart.setHflex(
"true");
96 butStart.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
98 public void onEvent(Event event) throws Exception {
99 Events.postEvent(new Event(Events.ON_USER, TaskSelector.this, null));
102 rowStart.appendChild(butStart);
105 final Row rowCancel =
new Row();
106 rows.appendChild(rowCancel);
108 rowCancel.appendChild(
new Space());
109 rowCancel.appendChild(
new Space());
111 Button butCancel =
new Button(Application.getString(
"lCancel"));
112 butCancel.setHflex(
"true");
113 butCancel.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
115 public void onEvent(Event event) throws Exception {
116 Events.postEvent(new Event(Events.ON_CANCEL, TaskSelector.this));
119 rowCancel.appendChild(butCancel);
121 WorkloadSet wls =
new WorkloadSet(humanResource,
true);
123 for(Workload wl : wls) {
124 final Row row =
new Row();
126 rows.appendChild(row);
128 row.appendChild(
new Label(Application.getString(
"lNow")));
130 Vlayout vbox =
new Vlayout();
131 row.appendChild(vbox);
132 vbox.appendChild(
new Label(wl.getTask().getName()));
133 vbox.appendChild(LabelTypes.getSoftLabel(wl.getTask().getDescription()));
134 vbox.appendChild(
new Label(wl.getTask().getOrderReference().getWorkOrder().getFullDescription()));
135 vbox.appendChild(
new Label(wl.getTask().getOrderReference().getWorkOrder().getContract().getName()));
137 Button select =
new Button(Application.getString(
"lStart") +
" " +Application.getString(
"lTask"));
138 select.setHflex(
"true");
139 select.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
141 public void onEvent(Event event) throws Exception {
142 Events.postEvent(new Event(Events.ON_CHANGE, TaskSelector.this, row.getValue()));
145 row.appendChild(select);