|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package info.bukova.isspst.ui.workgroups;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import org.zkoss.bind.annotation.Command;
|
|
|
|
|
import org.zkoss.bind.annotation.GlobalCommand;
|
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
@ -9,8 +11,10 @@ import org.zkoss.zul.TreeModel;
|
|
|
|
|
import org.zkoss.zul.TreeNode;
|
|
|
|
|
|
|
|
|
|
import info.bukova.isspst.data.Member;
|
|
|
|
|
import info.bukova.isspst.data.Role;
|
|
|
|
|
import info.bukova.isspst.data.Workgroup;
|
|
|
|
|
import info.bukova.isspst.filters.WorkgroupFilter;
|
|
|
|
|
import info.bukova.isspst.services.users.RoleService;
|
|
|
|
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
|
|
|
|
import info.bukova.isspst.ui.BoolConverter;
|
|
|
|
|
import info.bukova.isspst.ui.ListViewModel;
|
|
|
|
@ -19,6 +23,8 @@ public class WorkgroupList extends ListViewModel<Workgroup> {
|
|
|
|
|
|
|
|
|
|
@WireVariable
|
|
|
|
|
private WorkgroupService workgroupService;
|
|
|
|
|
@WireVariable
|
|
|
|
|
private RoleService roleService;
|
|
|
|
|
private WorkgroupTreeFactory treeFactory;
|
|
|
|
|
private BoolConverter boolConverter;
|
|
|
|
|
|
|
|
|
@ -40,21 +46,21 @@ public class WorkgroupList extends ListViewModel<Workgroup> {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotifyChange({"dataBean", "workgroupTreeModel", "ableToDelete"})
|
|
|
|
|
@NotifyChange({"dataBean", "workgroupTreeModel", "ableToDelete", "workgroupRoles"})
|
|
|
|
|
public void setDataBean(Workgroup data) {
|
|
|
|
|
super.setDataBean(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@GlobalCommand
|
|
|
|
|
@NotifyChange({ "dataList", "dataBean", "workgroupTreeModel", "ableToDelete" })
|
|
|
|
|
@NotifyChange({ "dataList", "dataBean", "workgroupTreeModel", "ableToDelete", "workgroupRoles" })
|
|
|
|
|
public void refresh() {
|
|
|
|
|
super.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Command
|
|
|
|
|
@NotifyChange({ "filter", "dataList", "dataBean", "workgroupTreeModel" })
|
|
|
|
|
@NotifyChange({ "filter", "dataList", "dataBean", "workgroupTreeModel", "workgroupRoles" })
|
|
|
|
|
public void filter() {
|
|
|
|
|
super.filter();
|
|
|
|
|
}
|
|
|
|
@ -63,4 +69,14 @@ public class WorkgroupList extends ListViewModel<Workgroup> {
|
|
|
|
|
return boolConverter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Role> getWorkgroupRoles() {
|
|
|
|
|
if (getDataBean() != null && getDataBean().isCentre()) {
|
|
|
|
|
return roleService.getCentreRoles();
|
|
|
|
|
} else if (getDataBean() != null) {
|
|
|
|
|
return roleService.getWorkgroupRoles();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|