Přidaná informační plocha. Ke členům komisí a středisek byla přidaná
vazba rodiče. Vyhodnocování příslušnosti ke středisku/komisi.multitenant
							parent
							
								
									53d5d262b1
								
							
						
					
					
						commit
						b1d27b085a
					
				@ -1,43 +0,0 @@
 | 
				
			|||||||
package info.bukova.isspst.data;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import javax.persistence.Column;
 | 
					 | 
				
			||||||
import javax.persistence.MappedSuperclass;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.hibernate.validator.constraints.NotEmpty;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@MappedSuperclass
 | 
					 | 
				
			||||||
public class RequestSubject extends BaseData {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	@Column(name = "CODE", unique = true)
 | 
					 | 
				
			||||||
	private String code;
 | 
					 | 
				
			||||||
	@Column(name = "NAME")
 | 
					 | 
				
			||||||
	private String name;
 | 
					 | 
				
			||||||
	@Column(name = "DESCRIPTION")
 | 
					 | 
				
			||||||
	private String description;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	@NotEmpty(message = "{MaterialFormCodeConstr}")
 | 
					 | 
				
			||||||
	public String getCode() {
 | 
					 | 
				
			||||||
		return code;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public void setCode(String code) {
 | 
					 | 
				
			||||||
		this.code = code;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public String getName() {
 | 
					 | 
				
			||||||
		return name;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public void setName(String name) {
 | 
					 | 
				
			||||||
		this.name = name;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public String getDescription() {
 | 
					 | 
				
			||||||
		return description;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public void setDescription(String description) {
 | 
					 | 
				
			||||||
		this.description = description;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -0,0 +1,134 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javax.persistence.Column;
 | 
				
			||||||
 | 
					import javax.persistence.Entity;
 | 
				
			||||||
 | 
					import javax.persistence.FetchType;
 | 
				
			||||||
 | 
					import javax.persistence.GeneratedValue;
 | 
				
			||||||
 | 
					import javax.persistence.GenerationType;
 | 
				
			||||||
 | 
					import javax.persistence.Id;
 | 
				
			||||||
 | 
					import javax.persistence.Inheritance;
 | 
				
			||||||
 | 
					import javax.persistence.InheritanceType;
 | 
				
			||||||
 | 
					import javax.persistence.JoinColumn;
 | 
				
			||||||
 | 
					import javax.persistence.ManyToOne;
 | 
				
			||||||
 | 
					import javax.persistence.Transient;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.hibernate.validator.constraints.NotEmpty;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Entity
 | 
				
			||||||
 | 
					@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
 | 
				
			||||||
 | 
					public abstract class RequirementSubject implements OwnedDataModel {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//OwnedDataModel
 | 
				
			||||||
 | 
						@Id
 | 
				
			||||||
 | 
						@Column(name =" ID")
 | 
				
			||||||
 | 
						@GeneratedValue(strategy = GenerationType.TABLE)
 | 
				
			||||||
 | 
						private int id;
 | 
				
			||||||
 | 
						@ManyToOne(fetch=FetchType.EAGER)
 | 
				
			||||||
 | 
						@JoinColumn(name="OWNED_BY_ID")
 | 
				
			||||||
 | 
						private User ownedBy;
 | 
				
			||||||
 | 
						@ManyToOne(fetch=FetchType.EAGER)
 | 
				
			||||||
 | 
						@JoinColumn(name="MODIFIED_BY_ID")
 | 
				
			||||||
 | 
						private User modifiedBy;
 | 
				
			||||||
 | 
						@Column(name = "CREATED")
 | 
				
			||||||
 | 
						private Date created;
 | 
				
			||||||
 | 
						@Column(name = "MODIFIED")
 | 
				
			||||||
 | 
						private Date modified;
 | 
				
			||||||
 | 
						@Transient
 | 
				
			||||||
 | 
						private boolean valid;
 | 
				
			||||||
 | 
						//RequirementSubject
 | 
				
			||||||
 | 
						@Column(name = "CODE", unique = true)
 | 
				
			||||||
 | 
						private String code;
 | 
				
			||||||
 | 
						@Column(name = "NAME")
 | 
				
			||||||
 | 
						private String name;
 | 
				
			||||||
 | 
						@Column(name = "DESCRIPTION")
 | 
				
			||||||
 | 
						private String description;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@NotEmpty(message = "{MaterialFormCodeConstr}")
 | 
				
			||||||
 | 
						public String getCode() {
 | 
				
			||||||
 | 
							return code;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setCode(String code) {
 | 
				
			||||||
 | 
							this.code = code;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public String getName() {
 | 
				
			||||||
 | 
							return name;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setName(String name) {
 | 
				
			||||||
 | 
							this.name = name;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public String getDescription() {
 | 
				
			||||||
 | 
							return description;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setDescription(String description) {
 | 
				
			||||||
 | 
							this.description = description;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public int getId() {
 | 
				
			||||||
 | 
							return id;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void setId(int id) {
 | 
				
			||||||
 | 
							this.id = id;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public User getOwnedBy() {
 | 
				
			||||||
 | 
							return ownedBy;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void setOwnedBy(User ownedBy) {
 | 
				
			||||||
 | 
							this.ownedBy = ownedBy;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public User getModifiedBy() {
 | 
				
			||||||
 | 
							return modifiedBy;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void setModifiedBy(User modifiedBy) {
 | 
				
			||||||
 | 
							this.modifiedBy = modifiedBy;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public Date getCreated() {
 | 
				
			||||||
 | 
							return created;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void setCreated(Date created) {
 | 
				
			||||||
 | 
							this.created = created;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public Date getModified() {
 | 
				
			||||||
 | 
							return modified;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void setModified(Date modified) {
 | 
				
			||||||
 | 
							this.modified = modified;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public boolean isValid() {
 | 
				
			||||||
 | 
							return valid;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						public void setValid(boolean valid) {
 | 
				
			||||||
 | 
							this.valid = valid;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,59 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.ui.dashboard;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					import java.util.HashMap;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import java.util.Map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.Role;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.User;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.Workgroup;
 | 
				
			||||||
 | 
					import info.bukova.isspst.services.workgroups.WorkgroupService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.security.core.context.SecurityContextHolder;
 | 
				
			||||||
 | 
					import org.zkoss.bind.annotation.Init;
 | 
				
			||||||
 | 
					import org.zkoss.zk.ui.select.annotation.WireVariable;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class DashBoardVM {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@WireVariable
 | 
				
			||||||
 | 
						private WorkgroupService workgroupService;
 | 
				
			||||||
 | 
						private User user;
 | 
				
			||||||
 | 
						private Map<Workgroup, List<Role>> groupRoles;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Init
 | 
				
			||||||
 | 
						public void init() {
 | 
				
			||||||
 | 
							user = User.class.cast(SecurityContextHolder.getContext().getAuthentication().getPrincipal());
 | 
				
			||||||
 | 
							groupRoles = new HashMap<Workgroup, List<Role>>();
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							List<Workgroup> wg = new ArrayList<Workgroup>();
 | 
				
			||||||
 | 
							if (workgroupService.getUserCentres(user) != null) {
 | 
				
			||||||
 | 
								wg.addAll(workgroupService.getUserCentres(user));
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (workgroupService.getUserWorkgroups(user) != null) {
 | 
				
			||||||
 | 
								wg.addAll(workgroupService.getUserWorkgroups(user));
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							for (Workgroup w : wg) {
 | 
				
			||||||
 | 
								List<Role> r = workgroupService.getUserWorkgroupRoles(w, user);
 | 
				
			||||||
 | 
								groupRoles.put(w, r);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public User getUser() {
 | 
				
			||||||
 | 
							return user;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public List<Workgroup> getCentres() {
 | 
				
			||||||
 | 
							return workgroupService.getUserCentres(user);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public List<Workgroup> getWorkgroups() {
 | 
				
			||||||
 | 
							return workgroupService.getUserWorkgroups(user);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public Map<Workgroup, List<Role>> getGroupRoles() {
 | 
				
			||||||
 | 
							return groupRoles;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,6 +1,47 @@
 | 
				
			|||||||
<?page title="Informace" contentType="text/html;charset=UTF-8"?>
 | 
					<?page title="Informace" contentType="text/html;charset=UTF-8"?>
 | 
				
			||||||
<zk>
 | 
					<zk>
 | 
				
			||||||
<window title="Informace" border="normal">
 | 
					<window border="normal" apply="org.zkoss.bind.BindComposer"
 | 
				
			||||||
New Content Here!
 | 
						viewModel="@id('vm') @init('info.bukova.isspst.ui.dashboard.DashBoardVM')">
 | 
				
			||||||
 | 
					<caption zclass="form-caption" label="${labels.Info}" />
 | 
				
			||||||
 | 
					<vbox>
 | 
				
			||||||
 | 
						<hbox>
 | 
				
			||||||
 | 
							<label value="${labels.LogedInUser}"/> <image src="/img/user-small.png"/> <label value="@load(vm.user)"/>
 | 
				
			||||||
 | 
						</hbox>
 | 
				
			||||||
 | 
						<groupbox mold="3d">
 | 
				
			||||||
 | 
							<caption image="/img/commission-small.png" label="${labels.CentresForRequirements}"/>
 | 
				
			||||||
 | 
							<hbox children="@load(vm.centres)">
 | 
				
			||||||
 | 
								<template name="children">
 | 
				
			||||||
 | 
								<listbox model="@load(vm.groupRoles[each])">
 | 
				
			||||||
 | 
									<listhead>
 | 
				
			||||||
 | 
										<listheader label="@load(each.fullName)"/>
 | 
				
			||||||
 | 
									</listhead>
 | 
				
			||||||
 | 
									<template name="model" var="role">
 | 
				
			||||||
 | 
										<listitem>
 | 
				
			||||||
 | 
											<listcell label="@load(role.description)"/>
 | 
				
			||||||
 | 
										</listitem>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
								</listbox>
 | 
				
			||||||
 | 
								</template>
 | 
				
			||||||
 | 
							</hbox>
 | 
				
			||||||
 | 
						</groupbox>
 | 
				
			||||||
 | 
						<groupbox mold="3d">
 | 
				
			||||||
 | 
							<caption image="/img/commission-small.png" label="${labels.WorkgroupMembership}"/>
 | 
				
			||||||
 | 
							<hbox children="@load(vm.workgroups)">
 | 
				
			||||||
 | 
								<template name="children">
 | 
				
			||||||
 | 
								<listbox model="@load(vm.groupRoles[each])">
 | 
				
			||||||
 | 
									<listhead>
 | 
				
			||||||
 | 
										<listheader label="@load(each.fullName)"/>
 | 
				
			||||||
 | 
									</listhead>
 | 
				
			||||||
 | 
									<template name="model" var="role">
 | 
				
			||||||
 | 
										<listitem>
 | 
				
			||||||
 | 
											<listcell label="@load(role.description)"/>
 | 
				
			||||||
 | 
										</listitem>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
								</listbox>
 | 
				
			||||||
 | 
								</template>
 | 
				
			||||||
 | 
							</hbox>
 | 
				
			||||||
 | 
						</groupbox>
 | 
				
			||||||
 | 
					</vbox>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</window>
 | 
					</window>
 | 
				
			||||||
</zk>
 | 
					</zk>
 | 
				
			||||||
					Loading…
					
					
				
		Reference in New Issue