Conflicts:
	src/main/webapp/app/navigation.zul
multitenant
František Přibyl 11 years ago
commit 6dcc93ee83

@ -355,4 +355,13 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
</dependencyManagement>
</project> </project>

@ -10,6 +10,7 @@ import info.bukova.isspst.services.munits.MUnitService;
import info.bukova.isspst.services.material.MaterialService; import info.bukova.isspst.services.material.MaterialService;
import info.bukova.isspst.services.users.RoleService; import info.bukova.isspst.services.users.RoleService;
import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
public class Constants { public class Constants {
@ -53,13 +54,15 @@ public class Constants {
public final static String MOD_BUILDINGS = "BUILDINGS"; public final static String MOD_BUILDINGS = "BUILDINGS";
public final static String MOD_MUNITS = "MUNITS"; public final static String MOD_MUNITS = "MUNITS";
public final static String MOD_MATERIAL = "MATERIAL"; public final static String MOD_MATERIAL = "MATERIAL";
public final static String MOD_WORKGROUPS = "WORKGROUPS";
public final static Module MODULES[] = { public final static Module MODULES[] = {
new Module(MOD_USERS, "Uživatelé", UserService.class) new Module(MOD_USERS, "Uživatelé", UserService.class),
, new Module(MOD_PERMISSIONS, "Práva", RoleService.class) new Module(MOD_PERMISSIONS, "Práva", RoleService.class),
, new Module(MOD_ADDRESSBOOK, "Dodavatelé", AdbService.class) new Module(MOD_ADDRESSBOOK, "Dodavatelé", AdbService.class),
, new Module(MOD_BUILDINGS, "Budovy", BuildingService.class) new Module(MOD_BUILDINGS, "Budovy", BuildingService.class),
, new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class) new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class),
, new Module(MOD_MATERIAL, "Materiál", MaterialService.class) new Module(MOD_MATERIAL, "Materiál", MaterialService.class),
new Module(MOD_WORKGROUPS, "Pracovní skupiny", WorkgroupService.class)
}; };
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava"; public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";

@ -0,0 +1,7 @@
package info.bukova.isspst.dao;
import info.bukova.isspst.data.Workgroup;
public interface WorkgroupDao extends BaseDao<Workgroup> {
}

@ -0,0 +1,13 @@
package info.bukova.isspst.dao.jpa;
import info.bukova.isspst.dao.WorkgroupDao;
import info.bukova.isspst.data.Workgroup;
public class WorkgroupDaoJPA extends BaseDaoJPA<Workgroup> implements WorkgroupDao {
@Override
public String getEntityName() {
return Workgroup.class.getSimpleName();
}
}

@ -0,0 +1,71 @@
package info.bukova.isspst.data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "JOBMAPPING")
public class JobMapping {
@Id
@Column(name = "ID")
@GeneratedValue
private int id;
@ManyToOne(fetch = FetchType.EAGER)
@JoinTable(name = "JOB_MEMBER", joinColumns = { @JoinColumn(name = "JOB_ID") }, inverseJoinColumns = { @JoinColumn(name = "MEMBER_ID") })
private Member member;
@ManyToOne(fetch = FetchType.EAGER)
@JoinTable(name = "JOB_ROLE", joinColumns = { @JoinColumn(name = "JOB_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") })
private Role role;
public JobMapping() {
}
public JobMapping(Member member, Role role) {
this.member = member;
this.role = role;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
public Role getRole() {
return role;
}
public void setRole(Role role) {
this.role = role;
}
@Override
public boolean equals(Object o) {
if (o instanceof JobMapping
&& ((JobMapping)o).getMember().equals(this.getMember())
&& ((JobMapping)o).getRole().equals(this.getRole())) {
return true;
}
return false;
}
}

@ -0,0 +1,63 @@
package info.bukova.isspst.data;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Transient;
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Member implements DataModel {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int id;
@Column(name = "CREATED")
private Date created;
@Column(name = "MODIFIED")
private Date modified;
@Transient
private boolean valid;
public abstract String getFullName();
public abstract boolean isHasJob();
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public boolean isValid() {
return valid;
}
public void setValid(boolean valid) {
this.valid = valid;
}
}

@ -2,6 +2,8 @@ package info.bukova.isspst.data;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table; import javax.persistence.Table;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
@ -21,15 +23,33 @@ public class Permission extends BaseSimpleData implements GrantedAuthority {
private String description; private String description;
@Column(name="MODULE") @Column(name="MODULE")
private String module; private String module;
@Column(name = "TYPE")
@Enumerated(EnumType.ORDINAL)
private PermissionType type;
public Permission(String authority, String description) { public Permission(String authority, String description) {
this();
this.authority = authority; this.authority = authority;
this.description = description; this.description = description;
this.module = ""; this.module = "";
} }
public Permission(String authority, String description, String module) {
this(authority, description);
this.module = module;
}
public Permission(String authority, String description, PermissionType type) {
this(authority, description, "", type);
}
public Permission(String authority, String description, String module, PermissionType type) {
this(authority, description, module);
this.type = type;
}
public Permission() { public Permission() {
type = PermissionType.GLOBAL;
} }
@Override @Override

@ -0,0 +1,9 @@
package info.bukova.isspst.data;
public enum PermissionType {
GLOBAL,
WORKGROUP,
CENTRE
}

@ -31,15 +31,21 @@ public class Role extends BaseSimpleData implements GrantedAuthority, DataModel
@LazyCollection(LazyCollectionOption.FALSE) @LazyCollection(LazyCollectionOption.FALSE)
@JoinTable(name="ROLE_PERMISSION", joinColumns={@JoinColumn(name="ROLE_ID")}, inverseJoinColumns={@JoinColumn(name="PERMISSION_ID")}) @JoinTable(name="ROLE_PERMISSION", joinColumns={@JoinColumn(name="ROLE_ID")}, inverseJoinColumns={@JoinColumn(name="PERMISSION_ID")})
private List<Permission> permissions; private List<Permission> permissions;
@Column(name = "WORKGROUP")
private boolean workgroup;
@Column(name = "CENTRE")
private boolean centre;
public Role(String authority, String description) { public Role(String authority, String description) {
this();
this.authority = authority; this.authority = authority;
this.description = description; this.description = description;
this.permissions = new ArrayList<Permission>();
} }
public Role() { public Role() {
this.permissions = new ArrayList<Permission>(); this.permissions = new ArrayList<Permission>();
centre = false;
workgroup = false;
} }
@Override @Override
@ -80,4 +86,20 @@ public class Role extends BaseSimpleData implements GrantedAuthority, DataModel
} }
} }
public boolean isWorkgroup() {
return workgroup;
}
public void setWorkgroup(boolean workgroup) {
this.workgroup = workgroup;
}
public boolean isCentre() {
return centre;
}
public void setCentre(boolean centre) {
this.centre = centre;
}
} }

@ -15,7 +15,7 @@ import org.springframework.security.core.userdetails.UserDetails;
@Entity @Entity
@Table(name="USER") @Table(name="USER")
public class User extends BaseSimpleData implements UserDetails, DataModel { public class User extends Member implements UserDetails, DataModel {
/** /**
* *
@ -129,10 +129,12 @@ public class User extends BaseSimpleData implements UserDetails, DataModel {
public String getFullName() { public String getFullName() {
String ret = ""; String ret = "";
if (firstName != null && !firstName.isEmpty()) { if (lastName != null && !lastName.isEmpty()) {
ret = firstName + " "; ret = lastName + " ";
} }
return ret + lastName == null ? "" : lastName; ret = ret + (firstName == null ? "" : firstName);
return ret;
} }
public String getFirstName() { public String getFirstName() {
@ -174,5 +176,24 @@ public class User extends BaseSimpleData implements UserDetails, DataModel {
public void setNotify(boolean notify) { public void setNotify(boolean notify) {
this.notify = notify; this.notify = notify;
} }
@Override
public boolean equals(Object o) {
if ((o instanceof User) && (((User)o).getId() == this.getId())) {
return true;
} else {
return false;
}
}
@Override
public String toString() {
return getFullName();
}
@Override
public boolean isHasJob() {
return true;
}
} }

@ -0,0 +1,125 @@
package info.bukova.isspst.data;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
@Entity
@Table(name = "WORKGROUP")
public class Workgroup extends Member implements OwnedDataModel {
@Column(name = "CODE")
private String code;
@Column(name = "NAME")
private String name;
@ManyToMany(cascade = {CascadeType.ALL})
@LazyCollection(LazyCollectionOption.FALSE)
@JoinTable(name="WORKGROUP_MEMBER", joinColumns={@JoinColumn(name="WORKGROUP_ID")}, inverseJoinColumns={@JoinColumn(name="JOBMAPPING_ID")})
private List<JobMapping> members;
@Column(name = "CENTRE")
private boolean centre;
//BaseData
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="OWNED_BY_ID")
private User ownedBy;
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="MODIFIED_BY_ID")
private User modifiedBy;
public Workgroup() {
members = new ArrayList<JobMapping>();
centre = false;
}
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 boolean isCentre() {
return centre;
}
public void setCentre(boolean centre) {
this.centre = centre;
}
@Override
public void setOwnedBy(User user) {
this.ownedBy = user;
}
@Override
public User getOwnedBy() {
return ownedBy;
}
@Override
public void setModifiedBy(User user) {
this.modifiedBy = user;
}
@Override
public User getModifiedBy() {
return modifiedBy;
}
@Override
public String getFullName() {
return name;
}
@Override
public boolean isHasJob() {
return false;
}
public List<JobMapping> getMembers() {
return members;
}
public void setMembers(List<JobMapping> members) {
this.members = members;
}
public void removeMember(JobMapping mapping) {
members.remove(mapping);
}
public void removeMember(Member member, Role role) {
JobMapping mapping = new JobMapping(member, role);
members.remove(mapping);
}
public boolean equals(Object o) {
if (o instanceof Workgroup && ((Workgroup)o).getId() == this.getId()) {
return true;
}
return false;
}
}

@ -1,60 +1,60 @@
package info.bukova.isspst.filters; package info.bukova.isspst.filters;
import static info.bukova.isspst.StringUtils.not0ToStr; import static info.bukova.isspst.StringUtils.not0ToStr;
import static info.bukova.isspst.StringUtils.nullStr; import static info.bukova.isspst.StringUtils.nullStr;
import info.bukova.isspst.data.Address; import info.bukova.isspst.data.Address;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Factory; import org.hamcrest.Factory;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher; import org.hamcrest.TypeSafeMatcher;
public class AddressFilter implements Filter<Address> { public class AddressFilter implements Filter<Address> {
private Address condAddr; private Address condAddr;
public AddressFilter(Address condAddr) { public AddressFilter(Address condAddr) {
this.condAddr = condAddr; this.condAddr = condAddr;
} }
private static class AddrMatcher extends TypeSafeMatcher<Address> { private static class AddrMatcher extends TypeSafeMatcher<Address> {
private Address condAddress; private Address condAddress;
public AddrMatcher(Address cond) { public AddrMatcher(Address cond) {
this.condAddress = cond; this.condAddress = cond;
} }
@Override @Override
public void describeTo(Description desc) { public void describeTo(Description desc) {
desc.appendText("address matches"); desc.appendText("address matches");
} }
@Override @Override
public boolean matchesSafely(Address item) { public boolean matchesSafely(Address item) {
return nullStr(item.getCompany()).toLowerCase().contains(nullStr(condAddress.getCompany()).toLowerCase()) return nullStr(item.getCompany()).toLowerCase().contains(nullStr(condAddress.getCompany()).toLowerCase())
&& nullStr(item.getCity()).toLowerCase().contains(nullStr(condAddress.getCity()).toLowerCase()) && nullStr(item.getCity()).toLowerCase().contains(nullStr(condAddress.getCity()).toLowerCase())
&& nullStr(item.getContactName()).toLowerCase().contains(nullStr(condAddress.getContactName()).toLowerCase()) && nullStr(item.getContactName()).toLowerCase().contains(nullStr(condAddress.getContactName()).toLowerCase())
&& nullStr(item.getStreet()).toLowerCase().contains(nullStr(condAddress.getStreet()).toLowerCase()) && nullStr(item.getStreet()).toLowerCase().contains(nullStr(condAddress.getStreet()).toLowerCase())
&& not0ToStr(item.getIc()).startsWith(not0ToStr(condAddress.getIc())) && not0ToStr(item.getIc()).startsWith(not0ToStr(condAddress.getIc()))
&& nullStr(item.getHouseNumber()).startsWith(nullStr(condAddress.getHouseNumber())); && nullStr(item.getHouseNumber()).startsWith(nullStr(condAddress.getHouseNumber()));
} }
@Factory @Factory
public static Matcher<Address> matchAddr(Address addr) { public static Matcher<Address> matchAddr(Address addr) {
return new AddrMatcher(addr); return new AddrMatcher(addr);
} }
} }
@Override @Override
public AddrMatcher matcher() { public AddrMatcher matcher() {
return new AddrMatcher(condAddr); return new AddrMatcher(condAddr);
} }
@Override @Override
public String queryString() { public String queryString() {
// TODO query string // TODO query string
return ""; return "";
} }
} }

@ -1,56 +1,56 @@
package info.bukova.isspst.filters; package info.bukova.isspst.filters;
import static info.bukova.isspst.StringUtils.nullStr; import static info.bukova.isspst.StringUtils.nullStr;
import info.bukova.isspst.data.Building; import info.bukova.isspst.data.Building;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Factory; import org.hamcrest.Factory;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher; import org.hamcrest.TypeSafeMatcher;
public class BuildingFilter implements Filter<Building> { public class BuildingFilter implements Filter<Building> {
private Building condBuilding; private Building condBuilding;
public BuildingFilter(Building condBuilding) { public BuildingFilter(Building condBuilding) {
this.condBuilding = condBuilding; this.condBuilding = condBuilding;
} }
private static class BuildingMatcher extends TypeSafeMatcher<Building> { private static class BuildingMatcher extends TypeSafeMatcher<Building> {
private Building condBuilding; private Building condBuilding;
public BuildingMatcher(Building cond) { public BuildingMatcher(Building cond) {
this.condBuilding = cond; this.condBuilding = cond;
} }
@Override @Override
public void describeTo(Description desc) { public void describeTo(Description desc) {
desc.appendText("buildings matches"); desc.appendText("buildings matches");
} }
@Override @Override
public boolean matchesSafely(Building item) { public boolean matchesSafely(Building item) {
return nullStr(item.getCode()).toLowerCase().contains(nullStr(condBuilding.getCode()).toLowerCase()) return nullStr(item.getCode()).toLowerCase().contains(nullStr(condBuilding.getCode()).toLowerCase())
&& nullStr(item.getName()).toLowerCase().contains(nullStr(condBuilding.getName()).toLowerCase()) && nullStr(item.getName()).toLowerCase().contains(nullStr(condBuilding.getName()).toLowerCase())
&& nullStr(item.getDescription()).toLowerCase().contains(nullStr(condBuilding.getDescription()).toLowerCase()); && nullStr(item.getDescription()).toLowerCase().contains(nullStr(condBuilding.getDescription()).toLowerCase());
} }
@Factory @Factory
public static Matcher<Building> matchBuilding(Building building) { public static Matcher<Building> matchBuilding(Building building) {
return new BuildingMatcher(building); return new BuildingMatcher(building);
} }
} }
@Override @Override
public BuildingMatcher matcher() { public BuildingMatcher matcher() {
return new BuildingMatcher(condBuilding); return new BuildingMatcher(condBuilding);
} }
@Override @Override
public String queryString() { public String queryString() {
// TODO query string // TODO query string
return ""; return "";
} }
} }

@ -1,10 +1,10 @@
package info.bukova.isspst.filters; package info.bukova.isspst.filters;
import org.hamcrest.TypeSafeMatcher; import org.hamcrest.TypeSafeMatcher;
public interface Filter<T> { public interface Filter<T> {
public TypeSafeMatcher<T> matcher(); public TypeSafeMatcher<T> matcher();
public String queryString(); public String queryString();
} }

@ -1,56 +1,56 @@
package info.bukova.isspst.filters; package info.bukova.isspst.filters;
import static info.bukova.isspst.StringUtils.nullStr; import static info.bukova.isspst.StringUtils.nullStr;
import info.bukova.isspst.data.MUnit; import info.bukova.isspst.data.MUnit;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Factory; import org.hamcrest.Factory;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher; import org.hamcrest.TypeSafeMatcher;
public class MUnitFilter implements Filter<MUnit> { public class MUnitFilter implements Filter<MUnit> {
private MUnit condMUnit; private MUnit condMUnit;
public MUnitFilter(MUnit condMUnit) { public MUnitFilter(MUnit condMUnit) {
this.condMUnit = condMUnit; this.condMUnit = condMUnit;
} }
private static class MUnitMatcher extends TypeSafeMatcher<MUnit> { private static class MUnitMatcher extends TypeSafeMatcher<MUnit> {
private MUnit condMUnit; private MUnit condMUnit;
public MUnitMatcher(MUnit cond) { public MUnitMatcher(MUnit cond) {
this.condMUnit = cond; this.condMUnit = cond;
} }
@Override @Override
public void describeTo(Description desc) { public void describeTo(Description desc) {
desc.appendText("munits matches"); desc.appendText("munits matches");
} }
@Override @Override
public boolean matchesSafely(MUnit item) { public boolean matchesSafely(MUnit item) {
return nullStr(item.getCode()).toLowerCase().contains(nullStr(condMUnit.getCode()).toLowerCase()) return nullStr(item.getCode()).toLowerCase().contains(nullStr(condMUnit.getCode()).toLowerCase())
&& nullStr(item.getName()).toLowerCase().contains(nullStr(condMUnit.getName()).toLowerCase()) && nullStr(item.getName()).toLowerCase().contains(nullStr(condMUnit.getName()).toLowerCase())
&& nullStr(item.getDescription()).toLowerCase().contains(nullStr(condMUnit.getDescription()).toLowerCase()); && nullStr(item.getDescription()).toLowerCase().contains(nullStr(condMUnit.getDescription()).toLowerCase());
} }
@Factory @Factory
public static Matcher<MUnit> matchMUnit(MUnit munit) { public static Matcher<MUnit> matchMUnit(MUnit munit) {
return new MUnitMatcher(munit); return new MUnitMatcher(munit);
} }
} }
@Override @Override
public MUnitMatcher matcher() { public MUnitMatcher matcher() {
return new MUnitMatcher(condMUnit); return new MUnitMatcher(condMUnit);
} }
@Override @Override
public String queryString() { public String queryString() {
// TODO query string // TODO query string
return ""; return "";
} }
} }

@ -1,56 +1,56 @@
package info.bukova.isspst.filters; package info.bukova.isspst.filters;
import static info.bukova.isspst.StringUtils.nullStr; import static info.bukova.isspst.StringUtils.nullStr;
import info.bukova.isspst.data.Material; import info.bukova.isspst.data.Material;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Factory; import org.hamcrest.Factory;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher; import org.hamcrest.TypeSafeMatcher;
public class MaterialFilter implements Filter<Material> { public class MaterialFilter implements Filter<Material> {
private Material condMaterial; private Material condMaterial;
public MaterialFilter(Material condMaterial) { public MaterialFilter(Material condMaterial) {
this.condMaterial = condMaterial; this.condMaterial = condMaterial;
} }
private static class MaterialMatcher extends TypeSafeMatcher<Material> { private static class MaterialMatcher extends TypeSafeMatcher<Material> {
private Material condMaterial; private Material condMaterial;
public MaterialMatcher(Material cond) { public MaterialMatcher(Material cond) {
this.condMaterial = cond; this.condMaterial = cond;
} }
@Override @Override
public void describeTo(Description desc) { public void describeTo(Description desc) {
desc.appendText("material matches"); desc.appendText("material matches");
} }
@Override @Override
public boolean matchesSafely(Material item) { public boolean matchesSafely(Material item) {
return nullStr(item.getCode()).toLowerCase().contains(nullStr(condMaterial.getCode()).toLowerCase()) return nullStr(item.getCode()).toLowerCase().contains(nullStr(condMaterial.getCode()).toLowerCase())
&& nullStr(item.getName()).toLowerCase().contains(nullStr(condMaterial.getName()).toLowerCase()) && nullStr(item.getName()).toLowerCase().contains(nullStr(condMaterial.getName()).toLowerCase())
&& nullStr(item.getDescription()).toLowerCase().contains(nullStr(condMaterial.getDescription()).toLowerCase()); && nullStr(item.getDescription()).toLowerCase().contains(nullStr(condMaterial.getDescription()).toLowerCase());
} }
@Factory @Factory
public static Matcher<Material> matchBuilding(Material material) { public static Matcher<Material> matchBuilding(Material material) {
return new MaterialMatcher(material); return new MaterialMatcher(material);
} }
} }
@Override @Override
public MaterialMatcher matcher() { public MaterialMatcher matcher() {
return new MaterialMatcher(condMaterial); return new MaterialMatcher(condMaterial);
} }
@Override @Override
public String queryString() { public String queryString() {
// TODO query string // TODO query string
return ""; return "";
} }
} }

@ -1,30 +1,30 @@
package info.bukova.isspst.services.addressbook; package info.bukova.isspst.services.addressbook;
import java.util.List; import java.util.List;
public class AresOdpoved { public class AresOdpoved {
private long pocetZaznamu; private long pocetZaznamu;
private String typVyhledani; private String typVyhledani;
private List<AresZaznam> aresZaznam; private List<AresZaznam> aresZaznam;
public long getPocetZaznamu() { public long getPocetZaznamu() {
return pocetZaznamu; return pocetZaznamu;
} }
public void setPocetZaznamu(long pocetZaznamu) { public void setPocetZaznamu(long pocetZaznamu) {
this.pocetZaznamu = pocetZaznamu; this.pocetZaznamu = pocetZaznamu;
} }
public String getTypVyhledani() { public String getTypVyhledani() {
return typVyhledani; return typVyhledani;
} }
public void setTypVyhledani(String typVyhledani) { public void setTypVyhledani(String typVyhledani) {
this.typVyhledani = typVyhledani; this.typVyhledani = typVyhledani;
} }
public List<AresZaznam> getAresZaznam() { public List<AresZaznam> getAresZaznam() {
return aresZaznam; return aresZaznam;
} }
public void setAresZaznam(List<AresZaznam> aresZaznam) { public void setAresZaznam(List<AresZaznam> aresZaznam) {
this.aresZaznam = aresZaznam; this.aresZaznam = aresZaznam;
} }
} }

@ -1,56 +1,56 @@
package info.bukova.isspst.services.addressbook; package info.bukova.isspst.services.addressbook;
public class AresZaznam { public class AresZaznam {
private String firma; private String firma;
private long ico; private long ico;
private String obec; private String obec;
private String mestskaCast; private String mestskaCast;
private String ulice; private String ulice;
private String cp; private String cp;
private String psc; private String psc;
public String getFirma() { public String getFirma() {
return firma; return firma;
} }
public void setFirma(String firma) { public void setFirma(String firma) {
this.firma = firma; this.firma = firma;
} }
public long getIco() { public long getIco() {
return ico; return ico;
} }
public void setIco(long ico) { public void setIco(long ico) {
this.ico = ico; this.ico = ico;
} }
public String getObec() { public String getObec() {
return obec; return obec;
} }
public void setObec(String obec) { public void setObec(String obec) {
this.obec = obec; this.obec = obec;
} }
public String getMestskaCast() { public String getMestskaCast() {
return mestskaCast; return mestskaCast;
} }
public void setMestskaCast(String mestskaCast) { public void setMestskaCast(String mestskaCast) {
this.mestskaCast = mestskaCast; this.mestskaCast = mestskaCast;
} }
public String getUlice() { public String getUlice() {
return ulice; return ulice;
} }
public void setUlice(String ulice) { public void setUlice(String ulice) {
this.ulice = ulice; this.ulice = ulice;
} }
public String getCp() { public String getCp() {
return cp; return cp;
} }
public void setCp(String cp) { public void setCp(String cp) {
this.cp = cp; this.cp = cp;
} }
public String getPsc() { public String getPsc() {
return psc; return psc;
} }
public void setPsc(String psc) { public void setPsc(String psc) {
this.psc = psc; this.psc = psc;
} }
} }

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:are="http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_answer/v_1.0.1" xmlns:are="http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_answer/v_1.0.1"
xmlns:dtt="http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.4" xmlns:dtt="http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.4"
xmlns:udt="http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/uvis_datatypes/v_1.0.1" > xmlns:udt="http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/uvis_datatypes/v_1.0.1" >
<xsl:template match="are:Odpoved"> <xsl:template match="are:Odpoved">
<AresOdpoved> <AresOdpoved>
<PocetZaznamu><xsl:value-of select="are:Pocet_zaznamu" /></PocetZaznamu> <PocetZaznamu><xsl:value-of select="are:Pocet_zaznamu" /></PocetZaznamu>
<TypVyhledani><xsl:value-of select="are:Typ_vyhledani" /></TypVyhledani> <TypVyhledani><xsl:value-of select="are:Typ_vyhledani" /></TypVyhledani>
<xsl:for-each select="are:Zaznam"> <xsl:for-each select="are:Zaznam">
<AresZaznam> <AresZaznam>
<Firma><xsl:value-of select="are:Obchodni_firma" /></Firma> <Firma><xsl:value-of select="are:Obchodni_firma" /></Firma>
<Ico><xsl:value-of select="are:ICO" /></Ico> <Ico><xsl:value-of select="are:ICO" /></Ico>
<Obec><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Nazev_obce" /></Obec> <Obec><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Nazev_obce" /></Obec>
<MestskaCast><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Nazev_mestske_casti" /></MestskaCast> <MestskaCast><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Nazev_mestske_casti" /></MestskaCast>
<Ulice><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Nazev_ulice" /></Ulice> <Ulice><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Nazev_ulice" /></Ulice>
<Cp><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Cislo_domovni" /><xsl:if test="are:Identifikace/are:Adresa_ARES/dtt:Cislo_orientacni">/<xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Cislo_orientacni" /> <Cp><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Cislo_domovni" /><xsl:if test="are:Identifikace/are:Adresa_ARES/dtt:Cislo_orientacni">/<xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:Cislo_orientacni" />
</xsl:if> </xsl:if>
</Cp> </Cp>
<Psc><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:PSC" /></Psc> <Psc><xsl:value-of select="are:Identifikace/are:Adresa_ARES/dtt:PSC" /></Psc>
</AresZaznam> </AresZaznam>
</xsl:for-each> </xsl:for-each>
</AresOdpoved> </AresOdpoved>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

@ -1,42 +1,42 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
"http://castor.codehaus.org/mapping.dtd"> "http://castor.codehaus.org/mapping.dtd">
<mapping> <mapping>
<class name="info.bukova.isspst.services.addressbook.AresOdpoved"> <class name="info.bukova.isspst.services.addressbook.AresOdpoved">
<map-to xml="AresOdpoved"/> <map-to xml="AresOdpoved"/>
<field name="PocetZaznamu" type="long"> <field name="PocetZaznamu" type="long">
<bind-xml name="PocetZaznamu" node="element"/> <bind-xml name="PocetZaznamu" node="element"/>
</field> </field>
<field name="TypVyhledani" type="string"> <field name="TypVyhledani" type="string">
<bind-xml name="TypVyhledani" node="element"/> <bind-xml name="TypVyhledani" node="element"/>
</field> </field>
<field name="AresZaznam" type="info.bukova.isspst.services.addressbook.AresZaznam" collection="arraylist"> <field name="AresZaznam" type="info.bukova.isspst.services.addressbook.AresZaznam" collection="arraylist">
<bind-xml name="AresZaznam" node="element"/> <bind-xml name="AresZaznam" node="element"/>
</field> </field>
</class> </class>
<class name="info.bukova.isspst.services.addressbook.AresZaznam"> <class name="info.bukova.isspst.services.addressbook.AresZaznam">
<field name="Firma" type="string"> <field name="Firma" type="string">
<bind-xml name="Firma" node="element"/> <bind-xml name="Firma" node="element"/>
</field> </field>
<field name="Ico" type="long"> <field name="Ico" type="long">
<bind-xml name="Ico" node="element"/> <bind-xml name="Ico" node="element"/>
</field> </field>
<field name="Ulice" type="string"> <field name="Ulice" type="string">
<bind-xml name="Ulice" node="element"/> <bind-xml name="Ulice" node="element"/>
</field> </field>
<field name="Cp" type="string"> <field name="Cp" type="string">
<bind-xml name="Cp" node="element"/> <bind-xml name="Cp" node="element"/>
</field> </field>
<field name="Obec" type="string"> <field name="Obec" type="string">
<bind-xml name="Obec" node="element"/> <bind-xml name="Obec" node="element"/>
</field> </field>
<field name="MestskaCast" type="string"> <field name="MestskaCast" type="string">
<bind-xml name="MestskaCast" node="element"/> <bind-xml name="MestskaCast" node="element"/>
</field> </field>
<field name="Psc" type="string"> <field name="Psc" type="string">
<bind-xml name="Psc" node="element"/> <bind-xml name="Psc" node="element"/>
</field> </field>
</class> </class>
</mapping> </mapping>

@ -1,10 +1,14 @@
package info.bukova.isspst.services.users; package info.bukova.isspst.services.users;
import java.util.List;
import info.bukova.isspst.data.Role; import info.bukova.isspst.data.Role;
import info.bukova.isspst.services.Service; import info.bukova.isspst.services.Service;
public interface RoleService extends Service<Role> { public interface RoleService extends Service<Role> {
public Role getRoleByAuthority(String authority); public Role getRoleByAuthority(String authority);
public List<Role> getWorkgroupRoles();
public List<Role> getCentreRoles();
} }

@ -1,5 +1,7 @@
package info.bukova.isspst.services.users; package info.bukova.isspst.services.users;
import java.util.List;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import info.bukova.isspst.data.Role; import info.bukova.isspst.data.Role;
@ -13,4 +15,16 @@ public class RoleServiceImpl extends AbstractService<Role> implements RoleServic
return this.selectSingle("from Role where authority = '" + authority + "'"); return this.selectSingle("from Role where authority = '" + authority + "'");
} }
@Override
@Transactional
public List<Role> getWorkgroupRoles() {
return this.execQuery("from Role where workgroup = true");
}
@Override
@Transactional
public List<Role> getCentreRoles() {
return this.execQuery("from Role where centre = true");
}
} }

@ -0,0 +1,20 @@
package info.bukova.isspst.services.workgroups;
import info.bukova.isspst.services.IsspstException;
public class WorkgroupException extends IsspstException {
/**
*
*/
private static final long serialVersionUID = -1729975111741519801L;
public final static String NO_WORGROUP = "WorkgroupNotAllowed";
public final static String MSUT_HAS_CENTER = "RoleMustHasCentre";
public final static String MUST_HAS_WORKGROUP = "WorkgroupMustHasCentre";
public WorkgroupException(String message) {
super(message);
}
}

@ -0,0 +1,17 @@
package info.bukova.isspst.services.workgroups;
import java.util.List;
import info.bukova.isspst.data.Member;
import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.Service;
public interface WorkgroupService extends Service<Workgroup> {
public void addMember(Workgroup workgroup, Member member, Role role);
public List<Workgroup> getWorkgroups();
public List<Workgroup> getCentres();
public boolean isMember(Workgroup workgroup, Member member);
}

@ -0,0 +1,57 @@
package info.bukova.isspst.services.workgroups;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import info.bukova.isspst.Constants;
import info.bukova.isspst.data.JobMapping;
import info.bukova.isspst.data.Member;
import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.AbstractOwnedService;
public class WorkgroupServiceImpl extends AbstractOwnedService<Workgroup> implements WorkgroupService {
@Override
public void addMember(Workgroup workgroup, Member member, Role role) {
if (!member.isHasJob() && !role.getAuthority().equals(Constants.ROLE_USER)) {
throw new WorkgroupException(WorkgroupException.NO_WORGROUP);
}
if (workgroup.isCentre() && !role.isCentre()) {
throw new WorkgroupException(WorkgroupException.MSUT_HAS_CENTER);
}
if (!workgroup.isCentre() && !role.isWorkgroup()) {
throw new WorkgroupException(WorkgroupException.MUST_HAS_WORKGROUP);
}
JobMapping mapping = new JobMapping(member, role);
if (!workgroup.getMembers().contains(mapping)) {
workgroup.getMembers().add(mapping);
}
}
@Override
@Transactional
public List<Workgroup> getWorkgroups() {
return this.execQuery("from Workgroup where centre = false");
}
@Override
@Transactional
public List<Workgroup> getCentres() {
return this.execQuery("from Workgroup where centre = true");
}
@Override
public boolean isMember(Workgroup workgroup, Member member) {
for (JobMapping jm : workgroup.getMembers()) {
if (jm.getMember().equals(member)) {
return true;
}
}
return false;
}
}

@ -0,0 +1,145 @@
package info.bukova.isspst.ui.workgroups;
import info.bukova.isspst.data.JobMapping;
import info.bukova.isspst.data.Member;
import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.users.RoleService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.FormViewModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.event.DropEvent;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Listitem;
public class WorkgroupForm extends FormViewModel<Workgroup> {
@WireVariable
private UserService userService;
@WireVariable
private RoleService roleService;
@WireVariable
private WorkgroupService workgroupService;
private List<Member> users;
@Init(superclass = true)
public void init() {
users = new ArrayList<Member>();
users.addAll(userService.getAll());
List<Workgroup> wg = workgroupService.getWorkgroups();
for (Workgroup w : wg) {
if (!workgroupService.isMember(getDataBean(), w)) {
users.add(w);
}
}
}
public List<Member> getUsers() {
return users;
}
public List<Role> getWorkgroupRoles() {
if (getDataBean().isCentre()) {
return roleService.getCentreRoles();
} else {
return roleService.getWorkgroupRoles();
}
}
@NotifyChange({"workgroupRoles", "centre"})
public void setCentre(boolean centre) {
getDataBean().setCentre(centre);
}
public boolean getCentre() {
return getDataBean().isCentre();
}
@Command
@NotifyChange({"users", "dataBean"})
public void addMember(@BindingParam("event") DropEvent event) {
Set<Listitem> selected = ((Listitem)event.getDragged()).getListbox().getSelectedItems();
if (selected.isEmpty()) {
try {
Member u = ((Listitem)event.getDragged()).getValue();
moveUser(u, event);
} catch(ClassCastException e) {
JobMapping u = ((Listitem)event.getDragged()).getValue();
moveUser(u, event);
}
return;
}
for (Listitem li : selected) {
try {
Member u = li.getValue();
moveUser(u, event);
} catch (ClassCastException e) {
JobMapping u = li.getValue();
moveUser(u, event);
}
}
}
private void moveUser(JobMapping u, DropEvent event) {
String source = getSource(event);
String target = getTarget(event);
if (source.equals(target)) {
return;
}
getDataBean().removeMember(u);
if (!target.equals("users")) {
moveUser(u.getMember(), event);
} else if (!u.getMember().isHasJob()) {
users.add(u.getMember());
}
}
private void moveUser(Member u, DropEvent event) {
String source = getSource(event);
String target = getTarget(event);
if (source.equals(target)) {
return;
}
workgroupService.addMember(getDataBean(), u, roleService.getRoleByAuthority(target));
if (!u.isHasJob()) {
users.remove(u);
}
}
private String getSource(DropEvent event) {
return ((Listitem)event.getDragged()).getListbox().getId();
}
private String getTarget(DropEvent event) {
String target;
if (event.getTarget() instanceof Listitem) {
target = ((Listitem)event.getTarget()).getListbox().getId();
} else {
target = event.getTarget().getId();
}
return target;
}
}

@ -0,0 +1,22 @@
package info.bukova.isspst.ui.workgroups;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.ListViewModel;
public class WorkgroupList extends ListViewModel<Workgroup> {
@WireVariable
private WorkgroupService workgroupService;
@Init
public void init() {
service = workgroupService;
dataClass = Workgroup.class;
formZul = "workgroupForm.zul";
}
}

@ -13,6 +13,9 @@
<mapping class="info.bukova.isspst.data.Building"></mapping> <mapping class="info.bukova.isspst.data.Building"></mapping>
<mapping class="info.bukova.isspst.data.MUnit"></mapping> <mapping class="info.bukova.isspst.data.MUnit"></mapping>
<mapping class="info.bukova.isspst.data.Material"></mapping> <mapping class="info.bukova.isspst.data.Material"></mapping>
<mapping class="info.bukova.isspst.data.Workgroup"></mapping>
<mapping class="info.bukova.isspst.data.Member"></mapping>
<mapping class="info.bukova.isspst.data.JobMapping"></mapping>
</session-factory> </session-factory>
</hibernate-configuration> </hibernate-configuration>

@ -87,6 +87,9 @@ UsersGridColumnSureName=Příjmení
AgendaMaterial=Materiál AgendaMaterial=Materiál
MaterialFormTitle=Materiál MaterialFormTitle=Materiál
AgendaWorkgroups=Pracovní skupiny
WorkgroupFormTitle=Pracvní skupina
ButtonStorno=Storno ButtonStorno=Storno
ButtonSave=Uložit ButtonSave=Uložit

@ -124,6 +124,10 @@
<property name="sessionFactory" ref="sessionFactory"/> <property name="sessionFactory" ref="sessionFactory"/>
</bean> </bean>
<bean id="commissionDao" class="info.bukova.isspst.dao.jpa.WorkgroupDaoJPA">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- Business logic --> <!-- Business logic -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/> <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
@ -180,5 +184,10 @@
<property name="dao" ref="materialDao"/> <property name="dao" ref="materialDao"/>
<property name="validator" ref="validator"/> <property name="validator" ref="validator"/>
</bean> </bean>
<bean id="workgroupService" class="info.bukova.isspst.services.workgroups.WorkgroupServiceImpl">
<property name="dao" ref="commissionDao"/>
<property name="validator" ref="validator"/>
</bean>
</beans> </beans>

@ -4,7 +4,11 @@
viewModel="@id('vm') @init('info.bukova.isspst.ui.users.PermissionForm')"> viewModel="@id('vm') @init('info.bukova.isspst.ui.users.PermissionForm')">
<caption zclass="form-caption" label="${labels.AgendaRights}" /> <caption zclass="form-caption" label="${labels.AgendaRights}" />
<label value="@load(vm.dataBean.description)" style="font-weight: bold;"/> <label value="@load(vm.dataBean.description)" style="font-weight: bold;"/>
<hbox>
<checkbox label="Práva pracovních skupin" checked="@bind(vm.dataBean.workgroup)"/>
<checkbox label="Práva středisek" checked="@bind(vm.dataBean.centre)"/>
</hbox>
<vbox children="@load(vm.modules)" width="530px"> <vbox children="@load(vm.modules)" width="530px">
<template name="children" var="module"> <template name="children" var="module">
<groupbox closable="false" mold="3d" width="530px"> <groupbox closable="false" mold="3d" width="530px">

@ -46,6 +46,7 @@
<menuitem label="${labels.AgendaUsers}" href="/admin/users" disabled="${not sec:isAllGranted('ROLE_ADMIN')}" width="120px"/> <menuitem label="${labels.AgendaUsers}" href="/admin/users" disabled="${not sec:isAllGranted('ROLE_ADMIN')}" width="120px"/>
<menuitem label="Práva" href="/admin/permissions" disabled="${not sec:isAllGranted('ROLE_ADMIN')}"/> <menuitem label="Práva" href="/admin/permissions" disabled="${not sec:isAllGranted('ROLE_ADMIN')}"/>
<menuitem label="Střediska" href="/admin/users" disabled="${not sec:isAllGranted('ROLE_ADMIN')}"/> <menuitem label="Střediska" href="/admin/users" disabled="${not sec:isAllGranted('ROLE_ADMIN')}"/>
<menuitem label="${labels.AgendaWorkgroups}" href="/workgroups" disabled="${not sec:isAllGranted('PERM_READ_WORKGROUPS')}"/>
</menubar> </menubar>
</tabpanel> </tabpanel>
<tabpanel> <tabpanel>

@ -1,55 +1,55 @@
.nicebutton { .nicebutton {
font-family: Arial; font-family: Arial;
color: #050005; color: #050005;
font-size: 12px; font-size: 12px;
padding-top: 3px; padding-top: 3px;
padding-right: 10px; padding-right: 10px;
padding-bottom: 3px; padding-bottom: 3px;
padding-left: 10px; padding-left: 10px;
margin: 4px; margin: 4px;
text-decoration: none; text-decoration: none;
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
-moz-border-radius: 5px; -moz-border-radius: 5px;
border-radius: 5px; border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px #666666; -webkit-box-shadow: 0px 1px 3px #666666;
-moz-box-shadow: 0px 1px 3px #666666; -moz-box-shadow: 0px 1px 3px #666666;
box-shadow: 0px 1px 3px #666666; box-shadow: 0px 1px 3px #666666;
text-shadow: 1px 1px 2px #666666; text-shadow: 1px 1px 2px #666666;
border: solid #8abaed 1px; border: solid #8abaed 1px;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#efefef)); background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#efefef));
background: -moz-linear-gradient(top, #ffffff, #efefef); background: -moz-linear-gradient(top, #ffffff, #efefef);
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#ffffff, endColorStr=#efefef); -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#ffffff, endColorStr=#efefef);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#ffffff, endColorStr=#efefef); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#ffffff, endColorStr=#efefef);
display:inline-block; /* IE is so silly */ display:inline-block; /* IE is so silly */
} }
.nicebutton:hover { .nicebutton:hover {
background: #c5e8fa; background: #c5e8fa;
} }
.nicebutton:disabled { .nicebutton:disabled {
font-family: Arial; font-family: Arial;
color: #c4c4c4; color: #c4c4c4;
font-size: 12px; font-size: 12px;
padding-top: 3px; padding-top: 3px;
padding-right: 10px; padding-right: 10px;
padding-bottom: 3px; padding-bottom: 3px;
padding-left: 10px; padding-left: 10px;
margin: 5px; margin: 5px;
text-decoration: none; text-decoration: none;
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
-moz-border-radius: 5px; -moz-border-radius: 5px;
border-radius: 5px; border-radius: 5px;
-webkit-box-shadow: 0px 1px 3px #666666; -webkit-box-shadow: 0px 1px 3px #666666;
-moz-box-shadow: 0px 1px 3px #666666; -moz-box-shadow: 0px 1px 3px #666666;
text-shadow: 0px 0px 0px #9e9e9e; text-shadow: 0px 0px 0px #9e9e9e;
box-shadow: 0px 1px 3px #666666; box-shadow: 0px 1px 3px #666666;
border: solid #d91c71 0px; border: solid #d91c71 0px;
background: #ebebeb; background: #ebebeb;
} }
.error { .error {
color: red; color: red;
} }
.bold { .bold {
font-weight: bold; font-weight: bold;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -1,4 +1,4 @@
<?page title="Přihlášení" contentType="text/html;charset=UTF-8"?> <?page title="Přihlášení" contentType="text/x-component;charset=UTF-8"?>
<zk> <zk>
<window title="Přihlášení" border="normal" width="300px"> <window title="Přihlášení" border="normal" width="300px">

@ -0,0 +1,10 @@
<?page title="${labels.AgendaCommissions}" contentType="text/html;charset=UTF-8"?>
<zk>
<zscript>
String gridZul = "workgroups.zul";
</zscript>
<include src="/app/template.zhtml"/>
</zk>

@ -0,0 +1,67 @@
<?page title="${labels.WorkgroupFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="editWin" closable="true" border="normal" position="center" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.workgroups.WorkgroupForm')">
<caption src="/img/commission.png" zclass="form-caption" label="${labels.WorkgroupFormTitle}" />
<vlayout>
<grid hflex="min">
<columns>
<column align="right" hflex="min" />
<column />
</columns>
<rows>
<row>
<cell sclass="row-title">${labels.code} :</cell>
<cell>
<textbox id="code" constraint="@load(vm.constriant)" width="200px" value="@bind(vm.dataBean.code)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.name} :</cell>
<cell>
<textbox id="name" width="200px" value="@bind(vm.dataBean.name)" />
</cell>
</row>
<row>
<cell>
<checkbox label="Středisko" checked="@bind(vm.centre)"/>
</cell>
</row>
</rows>
</grid>
<label value="Přetáhněte myší:"/>
<hlayout>
<listbox id="users" model="@bind(vm.users)" height="280px" width="200px" multiple="true"
droppable="true" onDrop="@command('addMember', event=event)">
<listhead>
<listheader label="Uživatelé" sort="czech(fullName)"/>
</listhead>
<template name="model">
<listitem image="@load(each.hasJob ? '/img/user-small.png' : '/img/commission-small.png')" label="@load(each.fullName)" draggable="user" droppable="user"
onDrop="@command('addMember', event=event)" attributes.item="@load(each)"/>
</template>
</listbox>
<vlayout children="@load(vm.workgroupRoles)">
<template name="children">
<listbox id="@load(each.authority)" model="@bind(vm.dataBean.members)" height="120px" width="200px" multiple="true"
droppable="true" onDrop="@command('addMember', event=event)">
<listhead>
<listheader label="@load(each.description)" sort="czech(fullName)"/>
</listhead>
<template name="model" var="member">
<listitem image="@load(member.member.hasJob ? '/img/user-small.png' : '/img/commission-small.png')" label="@load(member.member.fullName)" draggable="user" droppable="user"
onDrop="@command('addMember', event=event)" attributes.item="@load(member)" visible="@load(member.role.authority eq each.authority)"/>
</template>
</listbox>
</template>
</vlayout>
</hlayout>
<include src="/app/formButtons.zul" />
</vlayout>
</window>
</zk>

@ -0,0 +1,94 @@
<?page title="${labels.AgendaWorkgroups}" contentType="text/html;charset=UTF-8"?>
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.workgroups.WorkgroupList')">
<caption zclass="form-caption" label="${labels.AgendaWorkgroups}" />
<include src="/app/toolbar.zul" />
<hbox width="100%" height="500px">
<listbox model="@load(vm.dataList)" selectedItem="@bind(vm.dataBean)" width="680px" height="480px">
<listhead menupopup="auto">
<listheader label="${labels.code}" sort="czech(code)" width="10%" />
<listheader label="${labels.name}" sort="czech(name)" width="30%" />
</listhead>
<!--
<auxhead sclass="category-center" visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox value="@bind(vm.filterTemplate.code)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox value="@bind(vm.filterTemplate.name)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox value="@bind(vm.filterTemplate.description)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
-->
<template name="model">
<listitem>
<listcell label="@load(each.code)" />
<listcell label="@load(each.name)" />
</listitem>
</template>
</listbox>
<!-- <panel hflex="1" width="70%" height="480px">
<panelchildren>
<grid model="@load(vm.dataBean.approvers)" height="90px">
<columns>
<column label="Vedoucí" sort="auto(fullName)"/>
</columns>
<rows>
<template name="model">
<row>
<cell>
<image src="/img/user-small-red.png"/><label value="@load(each.fullName)"/>
</cell>
</row>
</template>
</rows>
</grid>
<grid model="@load(vm.dataBean.members)" height="290px">
<columns>
<column label="Členové" sort="auto(fullName)"/>
</columns>
<rows>
<template name="model">
<row>
<cell>
<image src="/img/user-small.png"/><label value="@load(each.fullName)"/>
</cell>
</row>
</template>
</rows>
</grid>
</panelchildren>
</panel> -->
</hbox>
</window>
</zk>
Loading…
Cancel
Save