18 package org.turro.erp.task;
20 import java.util.Collection;
21 import org.turro.string.Strings;
22 import org.turro.contacts.zul.label.ContactInfo;
23 import org.turro.elephant.context.Application;
24 import org.turro.erp.entity.Task;
25 import org.turro.erp.menu.ErpMenu;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.turro.zkoss.label.LabelAdapter;
28 import org.turro.zkoss.label.LabelTypes;
29 import org.zkoss.zk.ui.event.Event;
30 import org.zkoss.zk.ui.event.EventListener;
31 import org.zkoss.zk.ui.event.Events;
32 import org.zkoss.zk.ui.ext.AfterCompose;
33 import org.zkoss.zul.*;
49 this.filterGrid = filterGrid;
64 private void addRows() {
72 for(
final Task t : list) {
75 r.setSclass(
"invalid");
78 Vlayout vbox =
new Vlayout();
79 vbox.setSpacing(
"10px");
81 Hlayout hbox =
new Hlayout();
82 hbox.setSpacing(
"10px");
83 vbox.appendChild(hbox);
84 A name =
new A(t.getId() +
" - " + t.getName(),
"/_zul/images/task.png");
85 name.addEventListener(Events.ON_CLICK,
new EventListener() {
87 public void onEvent(Event event)
throws Exception {
89 ErpMenu.showTaskDetail(t,
true);
92 hbox.appendChild(name);
94 hbox.appendChild(
new Image(
"/_zul/images/milestone.png"));
96 hbox.appendChild(LabelTypes.getSoftLabel(Application.getString(t.getStatus().toString())));
97 if(t.getAptitudeDegree() !=
null) {
98 hbox.appendChild(
new Image(
"/_zul/images/aptitude.png"));
99 hbox.appendChild(LabelTypes.getSoftLabel(t.getAptitudeDegree().getFullName()));
101 if(t.getSupervised() !=
null) {
102 ContactInfo ci =
new ContactInfo(t.getSupervised().getHumanResource().getContract().getContractor());
103 ci.setSclass(
"softLabel");
104 hbox.appendChild(ci);
106 if(!Strings.isBlank(t.getDescription())) {
107 vbox.appendChild(
new LabelAdapter(LabelTypes.getSoftLabel(t.getDescription())).setMultiline(
true));
112 private void addColumns() {
Collection< Task > getTasks(List< IFilterValue > values)
void setFilterGrid(TaskFilterGrid filterGrid)
List< IFilterValue > getValues()
Columns getColumns(boolean create)
Rows getRows(boolean create)