Formulář v agendě uživatelů byl rozšířen o tab pro zadání adresy

uživatele. Na sestavy žádosti o služební cestu a vyúčtování služební
cesty byla přidána adresa. 
closes #128
multitenant
Josef Rokos 10 years ago
parent 74586f9820
commit 3a8954a909

@ -305,6 +305,12 @@
<artifactId>xercesImpl</artifactId> <artifactId>xercesImpl</artifactId>
<version>2.8.1</version> <version>2.8.1</version>
</dependency> </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<!-- Reporting --> <!-- Reporting -->
<dependency> <dependency>

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
@ -43,10 +44,13 @@ public class User extends Member implements UserDetails, DataModel {
private List<Role> authorities; private List<Role> authorities;
@Column(name="SETTINGS", length=1048576) @Column(name="SETTINGS", length=1048576)
private String settings; private String settings;
@Embedded
private UsersAddress address;
public User() { public User() {
authorities = new ArrayList<Role>(); authorities = new ArrayList<Role>();
setParents(new ArrayList<Workgroup>()); setParents(new ArrayList<Workgroup>());
address = new UsersAddress();
} }
@Override @Override
@ -207,4 +211,16 @@ public class User extends Member implements UserDetails, DataModel {
this.settings = settings; this.settings = settings;
} }
public UsersAddress getAddress() {
if (address == null) {
address = new UsersAddress();
}
return address;
}
public void setAddress(UsersAddress address) {
this.address = address;
}
} }

@ -0,0 +1,50 @@
package info.bukova.isspst.data;
import javax.persistence.Column;
import javax.persistence.Embeddable;
@Embeddable
public class UsersAddress {
@Column(name = "STREET")
private String street;
@Column(name = "HOUSE_NUMBER")
private String houseNumber;
@Column(name = "ZIP_CODE")
private String zipCode;
@Column(name = "CITY")
private String city;
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getHouseNumber() {
return houseNumber;
}
public void setHouseNumber(String houseNumber) {
this.houseNumber = houseNumber;
}
public String getZipCode() {
return zipCode;
}
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
}

@ -2,7 +2,7 @@
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="tripBill" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af"> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="tripBill" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f59e8277-a431-4cdc-abaa-c82c1cf193af">
<property name="ireport.zoom" value="2.0"/> <property name="ireport.zoom" value="2.0"/>
<property name="ireport.x" value="214"/> <property name="ireport.x" value="214"/>
<property name="ireport.y" value="422"/> <property name="ireport.y" value="0"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression> <defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression>
</parameter> </parameter>
@ -41,6 +41,11 @@
<fieldDescription><![CDATA[total]]></fieldDescription> <fieldDescription><![CDATA[total]]></fieldDescription>
</field> </field>
<field name="requirement.downPayment" class="java.math.BigDecimal"/> <field name="requirement.downPayment" class="java.math.BigDecimal"/>
<field name="ownedBy.address" class="info.bukova.isspst.data.UsersAddress"/>
<field name="ownedBy.address.street" class="java.lang.String"/>
<field name="ownedBy.address.houseNumber" class="java.lang.String"/>
<field name="ownedBy.address.zipCode" class="java.lang.String"/>
<field name="ownedBy.address.city" class="java.lang.String"/>
<background> <background>
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
@ -196,6 +201,15 @@ tuzemské pracovní cesty]]></text>
<line> <line>
<reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="0" width="1" height="281"/> <reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="0" width="1" height="281"/>
</line> </line>
<textField>
<reportElement uuid="8af60406-55bf-46f0-82e9-865dc9edbdb4" x="196" y="87" width="375" height="20">
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
</reportElement>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{ownedBy.address.street} + " " + $F{ownedBy.address.houseNumber} + ", " + $F{ownedBy.address.zipCode} + " " + $F{ownedBy.address.city}]]></textFieldExpression>
</textField>
</band> </band>
</pageHeader> </pageHeader>
<detail> <detail>

@ -49,6 +49,11 @@
<field name="requirement.vehicle.code" class="java.lang.String"/> <field name="requirement.vehicle.code" class="java.lang.String"/>
<field name="requirement.requireDownPayment" class="java.lang.Boolean"/> <field name="requirement.requireDownPayment" class="java.lang.Boolean"/>
<field name="requirement.downPayment" class="java.math.BigDecimal"/> <field name="requirement.downPayment" class="java.math.BigDecimal"/>
<field name="ownedBy.address" class="info.bukova.isspst.data.UsersAddress"/>
<field name="ownedBy.address.street" class="java.lang.String"/>
<field name="ownedBy.address.houseNumber" class="java.lang.String"/>
<field name="ownedBy.address.zipCode" class="java.lang.String"/>
<field name="ownedBy.address.city" class="java.lang.String"/>
<background> <background>
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
@ -327,6 +332,13 @@ L - letadlo, P - pěšky, T - taxi]]></text>
</reportElement> </reportElement>
<imageExpression><![CDATA[$P{P_APPROVER_SIGNATURE}]]></imageExpression> <imageExpression><![CDATA[$P{P_APPROVER_SIGNATURE}]]></imageExpression>
</image> </image>
<textField>
<reportElement uuid="16e5c4e2-a366-4eca-ad27-7db7fef6771c" x="186" y="27" width="375" height="20">
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{ownedBy.address.street} + " " + $F{ownedBy.address.houseNumber} + ", " + $F{ownedBy.address.zipCode} + " " + $F{ownedBy.address.city}]]></textFieldExpression>
</textField>
</band> </band>
</detail> </detail>
</jasperReport> </jasperReport>

@ -11,87 +11,125 @@
<caption <caption
zclass="form-caption" zclass="form-caption"
label="${labels.UsersFormTitle}" /> label="${labels.UsersFormTitle}" />
<grid
width="440px" <tabbox>
form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.userFormValidator)"> <tabs>
<columns> <tab label="Základní"/>
<column hflex="min"></column> <tab label="Adresa"/>
<column></column> </tabs>
<column></column> <tabpanels>
</columns> <tabpanel>
<rows> <grid
<row> width="440px"
<label value="${labels.UsersFormLogin}" /> form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.userFormValidator)">
<textbox <columns>
value="@bind(vm.dataBean.username)" <column hflex="min"></column>
instant="true" <column></column>
disabled="@load(vm.editRec)" <column></column>
onChange="@command('checkLogin')" /> </columns>
<label <rows>
value="Login je obsazený" <row>
sclass="error" <label value="${labels.UsersFormLogin}" />
visible="@load(not vm.loginFree)" /> <textbox
</row> value="@bind(vm.dataBean.username)"
<row> instant="true"
<label value="${labels.UsersFormFirstName}" /> disabled="@load(vm.editRec)"
<textbox value="@bind(vm.dataBean.firstName)" /> onChange="@command('checkLogin')" />
</row> <label
<row> value="Login je obsazený"
<label value="${labels.UsersFormSureName}" /> sclass="error"
<textbox value="@bind(vm.dataBean.lastName)" /> visible="@load(not vm.loginFree)" />
</row> </row>
<row> <row>
<label value="${labels.UsersFormPersonalID}" /> <label value="${labels.UsersFormFirstName}" />
<textbox <textbox value="@bind(vm.dataBean.firstName)" />
value="@bind(vm.dataBean.personalNumber)" </row>
width="90px" /> <row>
</row> <label value="${labels.UsersFormSureName}" />
<row> <textbox value="@bind(vm.dataBean.lastName)" />
<label value="${labels.UsersFormEmail}" /> </row>
<textbox value="@bind(vm.dataBean.email)" /> <row>
</row> <label value="${labels.UsersFormPersonalID}" />
<row> <textbox
<label value="" /> value="@bind(vm.dataBean.personalNumber)"
<checkbox width="90px" />
label="${labels.UsersFormSendNotify}" </row>
checked="@bind(vm.dataBean.notify)" /> <row>
</row> <label value="${labels.UsersFormEmail}" />
<row> <textbox value="@bind(vm.dataBean.email)" />
<label value="${labels.UsersFormPassword}" /> </row>
<textbox <row>
id="idUserPasswordOriginal" <label value="" />
value="@save(vm.password, before='save')" <checkbox
type="password" label="${labels.UsersFormSendNotify}"
instant="true" /> checked="@bind(vm.dataBean.notify)" />
</row> </row>
<row> <row>
<label value="${labels.UsersFormRepeatPassword}" /> <label value="${labels.UsersFormPassword}" />
<textbox <textbox
id="idUserPasswordDuplicate" id="idUserPasswordOriginal"
value="@save(vm.retPasswd, before='save')" value="@save(vm.password, before='save')"
type="password" type="password"
instant="true" /> instant="true" />
</row> </row>
<row> <row>
<label value="" /> <label value="${labels.UsersFormRepeatPassword}" />
<checkbox <textbox
label="${labels.UsersFormActive}" id="idUserPasswordDuplicate"
checked="@bind(vm.dataBean.enabled)" value="@save(vm.retPasswd, before='save')"
disabled="@load(vm.dataBean.username eq 'admin')" /> type="password"
</row> instant="true" />
</rows> </row>
</grid> <row>
<groupbox mold="3d"> <label value="" />
<caption label="Role" /> <checkbox
<vbox children="@load(vm.userRoles.roleChecks)"> label="${labels.UsersFormActive}"
<template name="children"> checked="@bind(vm.dataBean.enabled)"
<checkbox disabled="@load(vm.dataBean.username eq 'admin')" />
label="@load(each.role.description)" </row>
checked="@bind(each.checked)" </rows>
disabled="@load(vm.dataBean.username eq 'admin')" /> </grid>
</template> <groupbox mold="3d">
</vbox> <caption label="Role" />
</groupbox> <vbox children="@load(vm.userRoles.roleChecks)">
<template name="children">
<checkbox
label="@load(each.role.description)"
checked="@bind(each.checked)"
disabled="@load(vm.dataBean.username eq 'admin')" />
</template>
</vbox>
</groupbox>
</tabpanel>
<tabpanel>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<label value="${labels.SuppliersFormStreet}"/>
<textbox value="@bind(vm.dataBean.address.street)"/>
</row>
<row>
<label value="${labels.SuppliersFormNo}"/>
<textbox value="@bind(vm.dataBean.address.houseNumber)"/>
</row>
<row>
<label value="${labels.SuppliersFormZIP}"/>
<textbox value="@bind(vm.dataBean.address.zipCode)"/>
</row>
<row>
<label value="${labels.SuppliersFormCity}"/>
<textbox value="@bind(vm.dataBean.address.city)"/>
</row>
</rows>
</grid>
</tabpanel>
</tabpanels>
</tabbox>
<include src="/app/formButtons.zul" /> <include src="/app/formButtons.zul" />
</window> </window>
</zk> </zk>
Loading…
Cancel
Save