Neaktivní uživatelé se nenabízí v seznamech pro výběr uživatele (spolucestující...). V agendě Uživatelé a Střediska/komise jsou barevně odlišeni.

closes #239
Verze_3.0
Josef Rokos 9 years ago
parent 1230959854
commit 84154ccbff

@ -234,7 +234,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
@Override
@Transactional
public List<User> getUsersForCombo() {
Query q = dao.getQuery("from User u order by u.lastName");
Query q = dao.getQuery("from User u where u.enabled = true order by u.lastName");
return q.list();
}

@ -1,9 +1,5 @@
package info.bukova.isspst.ui.mail;
import static ch.lambdaj.Lambda.filter;
import static ch.lambdaj.Lambda.having;
import static ch.lambdaj.Lambda.on;
import static org.hamcrest.Matchers.startsWith;
import info.bukova.isspst.data.Address;
import info.bukova.isspst.data.Member;
import info.bukova.isspst.data.User;
@ -15,10 +11,6 @@ import info.bukova.isspst.reporting.ReportDefinition;
import info.bukova.isspst.services.addressbook.AdbService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.DocumentViewModel;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
@ -28,6 +20,14 @@ import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import java.util.ArrayList;
import java.util.List;
import static ch.lambdaj.Lambda.filter;
import static ch.lambdaj.Lambda.having;
import static ch.lambdaj.Lambda.on;
import static org.hamcrest.Matchers.startsWith;
public class MailForm extends DocumentViewModel
{
@ -69,7 +69,7 @@ public class MailForm extends DocumentViewModel
addressbook = new ArrayList<Address>();
}
users = userService.getAll();
users = userService.getUsersForCombo();
selectedAddresses = new ArrayList<Address>();
selectedUsers = new ArrayList<User>();

@ -0,0 +1,22 @@
package info.bukova.isspst.ui.renderers;
import info.bukova.isspst.data.JobMapping;
import info.bukova.isspst.data.User;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
/**
* @author Pepa Rokos
*/
public class JobMappingItemRenderer extends GenericListitemRenderer<JobMapping> {
@Override
protected void changeProperties(Listbox lb, Listitem li, int index, String varnm) {
JobMapping jm = getObjectOfStates();
if (jm.getMember() instanceof User && !((User)jm.getMember()).isEnabled()) {
li.setSclass("user-disabled");
}
}
}

@ -0,0 +1,20 @@
package info.bukova.isspst.ui.renderers;
import info.bukova.isspst.data.User;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
/**
* @author Pepa Rokos
*/
public class UserItemRenderer extends GenericListitemRenderer<User> {
@Override
protected void changeProperties(Listbox lb, Listitem li, int index, String varnm) {
User u = getObjectOfStates();
if (!u.isEnabled()) {
li.setSclass("user-disabled");
}
}
}

@ -9,19 +9,20 @@ import info.bukova.isspst.data.User;
import info.bukova.isspst.filters.UserFilter;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.ListViewModel;
import java.util.ArrayList;
import java.util.List;
import info.bukova.isspst.ui.renderers.UserItemRenderer;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import java.util.ArrayList;
import java.util.List;
public class UsersList extends ListViewModel<User> {
@WireVariable
private UserService userService;
private UserItemRenderer itemRenderer;
@Init
public void init() {
@ -29,6 +30,7 @@ public class UsersList extends ListViewModel<User> {
dataClass = User.class;
formZul = "userForm.zul";
dataFilter = new UserFilter(getFilterTemplate());
itemRenderer = new UserItemRenderer();
}
public List<Module> getModules() {
@ -88,5 +90,7 @@ public class UsersList extends ListViewModel<User> {
return true;
}
public UserItemRenderer getItemRenderer() {
return itemRenderer;
}
}

@ -13,11 +13,8 @@ import info.bukova.isspst.services.workgroups.WorkgroupException;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.BigDecimalConverter;
import info.bukova.isspst.ui.FormViewModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import info.bukova.isspst.ui.renderers.JobMappingItemRenderer;
import info.bukova.isspst.ui.renderers.UserItemRenderer;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
@ -27,8 +24,14 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.Messagebox;
import static ch.lambdaj.Lambda.*;
import static org.hamcrest.Matchers.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static ch.lambdaj.Lambda.filter;
import static ch.lambdaj.Lambda.having;
import static ch.lambdaj.Lambda.on;
import static org.hamcrest.Matchers.startsWith;
public class WorkgroupForm extends FormViewModel<Workgroup> {
@ -42,6 +45,8 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
private String findUser;
private List<Member> selectedUsers;
private BigDecimalConverter bdConverter;
private JobMappingItemRenderer itemRenderer;
private UserItemRenderer userItemRenderer;
@Init(superclass = true)
public void init() {
@ -49,6 +54,8 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
users.addAll(userService.getAll());
selectedUsers = new ArrayList<Member>();
bdConverter = new BigDecimalConverter();
itemRenderer = new JobMappingItemRenderer();
userItemRenderer = new UserItemRenderer();
}
public List<Member> getUsers() {
@ -239,4 +246,11 @@ public class WorkgroupForm extends FormViewModel<Workgroup> {
return bdConverter;
}
public JobMappingItemRenderer getItemRenderer() {
return itemRenderer;
}
public UserItemRenderer getUserItemRenderer() {
return userItemRenderer;
}
}

@ -11,6 +11,7 @@
<hbox width="100%" vflex="1">
<listbox model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)"
itemRenderer="@load(vm.itemRenderer)"
width="650px"
vflex="1">
<listhead menupopup="auto">

@ -59,7 +59,8 @@
maxlength="@load(vm.lengthText)"
width="300px" />
<listbox id="users" model="@bind(vm.users)" height="380px" width="300px" multiple="true"
droppable="true" onDrop="@command('addMember', event=event)" selectedItems="@bind(vm.selectedUsers)">
droppable="true" onDrop="@command('addMember', event=event)" selectedItems="@bind(vm.selectedUsers)"
itemRenderer="@load(vm.userItemRenderer)">
<listhead>
<listheader label="Uživatelé" sort="czech(fullName)"/>
</listhead>
@ -82,6 +83,7 @@
<listbox id="@load(each.authority)"
model="@bind(vm.dataBean.members)" height="200px" width="290px"
multiple="true" droppable="true"
itemRenderer="@load(vm.itemRenderer)"
onDrop="@command('addMember', event=event)">
<!-- <listhead>
<listheader label="@load(each.description)" sort="czech(fullName)"/>

@ -89,3 +89,7 @@
.req-select-approved-project {
background-color: #87cefa !important;
}
.user-disabled {
background-color: #fff2dd !important;
}

Loading…
Cancel
Save