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

@ -306,6 +306,12 @@
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<!-- Reporting -->
<dependency>
<groupId>net.sf.jasperreports</groupId>

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
@ -43,10 +44,13 @@ public class User extends Member implements UserDetails, DataModel {
private List<Role> authorities;
@Column(name="SETTINGS", length=1048576)
private String settings;
@Embedded
private UsersAddress address;
public User() {
authorities = new ArrayList<Role>();
setParents(new ArrayList<Workgroup>());
address = new UsersAddress();
}
@Override
@ -207,4 +211,16 @@ public class User extends Member implements UserDetails, DataModel {
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">
<property name="ireport.zoom" value="2.0"/>
<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">
<defaultValueExpression><![CDATA["/home/pepa/Dokumenty/dev/java/isspst/"]]></defaultValueExpression>
</parameter>
@ -41,6 +41,11 @@
<fieldDescription><![CDATA[total]]></fieldDescription>
</field>
<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>
<band splitType="Stretch"/>
</background>
@ -196,6 +201,15 @@ tuzemské pracovní cesty]]></text>
<line>
<reportElement uuid="bf83547c-60d9-4f95-a5f1-db0763ba17cb" x="571" y="0" width="1" height="281"/>
</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>
</pageHeader>
<detail>

@ -49,6 +49,11 @@
<field name="requirement.vehicle.code" class="java.lang.String"/>
<field name="requirement.requireDownPayment" class="java.lang.Boolean"/>
<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>
<band splitType="Stretch"/>
</background>
@ -327,6 +332,13 @@ L - letadlo, P - pěšky, T - taxi]]></text>
</reportElement>
<imageExpression><![CDATA[$P{P_APPROVER_SIGNATURE}]]></imageExpression>
</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>
</detail>
</jasperReport>

@ -11,6 +11,14 @@
<caption
zclass="form-caption"
label="${labels.UsersFormTitle}" />
<tabbox>
<tabs>
<tab label="Základní"/>
<tab label="Adresa"/>
</tabs>
<tabpanels>
<tabpanel>
<grid
width="440px"
form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.userFormValidator)">
@ -92,6 +100,36 @@
</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" />
</window>
</zk>
Loading…
Cancel
Save