Formulář ag. Služební cesty / Aktuální požadavky

• přidáno textové pole "Cizí osoby"
• upraven popisek formuláře
• upraven vzhled a zarovnání prvků
• přidána kontrola ukazatele při promazávání souborů na disku i v
databázi
• sjednocena maska pro formátování data v <datebox>
closes #197
Verze_2.0
František Přibyl 10 years ago
parent 9c5679af2c
commit ac90b0a2e3

@ -1,16 +1,30 @@
package info.bukova.isspst.data;
import info.bukova.isspst.storage.EntityWithAttachment;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.search.annotations.*;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
@Entity
@Table(name = "TRIPREQUIREMENT")
@Indexed
@ -32,6 +46,11 @@ public class TripRequirement extends RequirementBase implements EntityWithAttach
@LazyCollection(LazyCollectionOption.TRUE)
@JoinTable(name="TRIPREQUIREMENT_PASSANGER", joinColumns={@JoinColumn(name="TRIPREQUIREMENT_ID")}, inverseJoinColumns={@JoinColumn(name="USER_ID")})
private List<User> passengers;
@Column(name = "FOREIGN_PERSONS")
@Field(index = Index.YES, analyze = Analyze.YES)
private String foreignPersons;
@Embedded
private Vehicle vehicle;
@Column(name = "REQUIRE_DOWN_PAYMENT")
@ -99,6 +118,16 @@ public class TripRequirement extends RequirementBase implements EntityWithAttach
this.passengers = passengers;
}
public String getForeignPersons()
{
return foreignPersons;
}
public void setForeignPersons(String foreignPersons)
{
this.foreignPersons = foreignPersons;
}
public Vehicle getVehicle() {
return vehicle;
}

@ -1,21 +1,28 @@
package info.bukova.isspst.storage;
import info.bukova.isspst.dao.QueryDao;
import info.bukova.isspst.data.FileContent;
import info.bukova.isspst.data.FileMetainfo;
import info.bukova.isspst.services.fulltext.Extractor;
import info.bukova.isspst.services.fulltext.ExtractorFactory;
import org.apache.commons.codec.binary.Hex;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.UUID;
import org.apache.commons.codec.binary.Hex;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
/**
* @author Pepa Rokos
*
@ -245,12 +252,17 @@ public class DocumentFileStorageImpl extends AbstractFileStorage<FileMetainfo> i
boolean fileExists = false;
for (FileMetainfo info : infos) {
if (info.getContent().getPathInFilesystem().equals(f.getName())) {
FileContent fileContent = info.getContent();
if ((fileContent != null) && f.isFile() && fileContent.getPathInFilesystem().equals(f.getName()))
{
fileExists = true;
break;
}
}
if (!fileExists && f.isFile()) {
if (!fileExists && f.isFile())
{
f.delete();
}
}

@ -15,7 +15,7 @@ RequirementsFormPurpose=Účel cesty
RequirementsFormStartDateTime=Datum a čas odjezdu
RequirementsFormEndTravel=Konec cesty
RequirementsFormEndDate=Datum příjezdu
RequirementsFormPassengers=Spolucestující:
RequirementsFormPassengers=Spolucestující
RequirementsFormVehicle=Dopravní prostředek:
RequirementsGridNumberSerie=Číslo
RequirementsGridReqDate=Datum požadavku
@ -393,3 +393,9 @@ Search=Hledat
Pending = Nevyřízené
Archive = Archiv
Completed = Vyřízeno
GenerateBillingForPassengers = Generovat vyúčtování pro spolucestující
Passenger = Pasažér
ChooseThePasseger = Vyberte pasažéra
TransportMode = Způsob dopravy
ForeignPersons = Cizí osoby

@ -1,37 +1,54 @@
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
<zk
xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<vbox>
<button image="/img/upload-016.png"
label="Připojit soubor"
upload="true"
onUpload="@command('uploadAttachment')"
sclass="nicebutton" />
<grid model="@load(vm.attachments)" height="180px">
<vbox vflex="1">
<button
vflex="min"
image="/img/upload-016.png"
label="Připojit soubor"
upload="true"
onUpload="@command('uploadAttachment')"
sclass="nicebutton" />
<grid
model="@load(vm.attachments)"
vflex="1">
<columns>
<column label="Soubor" width="220px"/>
<column label="Popis" hflex="max"/>
<column width="200px"/>
<column
label="Soubor"
width="220px" />
<column
label="Popis"
hflex="max" />
<column width="200px" />
</columns>
<rows>
<template name="model">
<row>
<a href="@load('/api/dl/'.concat(each.pathInFilesystem).concat('/').concat(each.fileName))"
label="@load(each.fileName)"
target="blank"/>
<textbox value="@bind(each.description)" sclass="grid-textbox-max"/>
<a
href="@load('/api/dl/'.concat(each.pathInFilesystem).concat('/').concat(each.fileName))"
label="@load(each.fileName)"
target="blank" />
<textbox
value="@bind(each.description)"
sclass="grid-textbox-max" />
<hbox>
<button image="/img/delete-016.png" label="Odebrat" onClick="@command('deleteAttachment', attachment=each)" sclass="nicebutton"/>
<button image="/img/download-016.png" label="Stáhnout" onClick="@command('downloadAttachment', attachment=each)" sclass="nicebutton"/>
<button
image="/img/delete-016.png"
label="Odebrat"
onClick="@command('deleteAttachment', attachment=each)"
sclass="nicebutton" />
<button
image="/img/download-016.png"
label="Stáhnout"
onClick="@command('downloadAttachment', attachment=each)"
sclass="nicebutton" />
</hbox>
</row>
</template>
</rows>
</grid>
</vbox>
</zk>

@ -15,7 +15,9 @@
<vbox hflex="1">
<hbox>
<label value="${labels.RequirementApproveDate}"/>
<datebox value="@bind(vm.approveDate)"/>
<datebox
value="@bind(vm.approveDate)"
format="${labels.DateFormat}" />
</hbox>
<separator bar="true" hflex="1"/>
<hbox>

@ -56,6 +56,7 @@
<listcell>
<datebox
value="@bind(each.invoiceDate)"
format="${labels.DateFormat}"
inplace="true"
onFocus="@command('onFocus', item=each)" />
</listcell>

@ -1,5 +1,6 @@
<?page title="${labels.RequirementsFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
<zk
xmlns="http://www.zkoss.org/2005/zul"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
@ -15,10 +16,19 @@
<caption
src="/img/reqact.png"
zclass="form-caption"
label="${labels.RequirementsFormTitle}" />
<vlayout form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.validator)">
<hbox>
<grid hflex="min">
label="${labels.TripRequirement}" />
<!-- Dialog -->
<vlayout
form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.validator)"
sclass="addScrollbar"
vflex="1">
<!-- Formulář + soubory -->
<hbox
hflex="1"
vflex="min">
<grid
hflex="min"
vflex="1">
<columns>
<column
align="right"
@ -74,17 +84,16 @@
<cell sclass="row-title">${labels.RequirementsFormStartDateTime} :</cell>
<cell>
<hbox>
<datebox
id="tripDate"
width="200px"
format="medium"
value="@bind(fx.tripDate)" />
<timebox
id="tripTime"
width="90px"
format="short"
value="@bind(fx.tripDate)" />
<datebox
id="tripDate"
width="200px"
format="${labels.DateFormat}"
value="@bind(fx.tripDate)" />
<timebox
id="tripTime"
width="90px"
format="short"
value="@bind(fx.tripDate)" />
</hbox>
</cell>
</row>
@ -124,76 +133,148 @@
<datebox
id="endDate"
width="300px"
format="medium"
format="${labels.DateFormat}"
value="@bind(fx.endDate)" />
</cell>
</row>
</rows>
</grid>
<include src="/app/uploadComponents.zul"/>
<include
src="/app/uploadComponents.zul"
vflex="1" />
</hbox>
<vbox>
<label value="${labels.RequirementsFormPassengers}"/>
<hbox>
<combobox model="@load(vm.users)"
autocomplete="true"
selectedItem="@bind(vm.selUser)">
<template name="model">
<comboitem label="@load(each)"/>
</template>
</combobox>
<button label="${labels.Confirm}"
onClick="@command('addPassanger')"
sclass="nicebutton"
disabled="@load(vm.selUser eq null)"/>
</hbox>
<checkbox label="Generovat vyúčtování pro spolucestující"
checked="@bind(vm.dataBean.billForPassengers)"
disabled="@load(empty vm.passengers)"/>
<grid model="@load(vm.passengers)" width="700px">
<columns>
<column/>
<column/>
</columns>
<rows>
<template name="model">
<row>
<label value="@load(each)" />
<button label="${labels.RemoveItem}"
onClick="@command('removePassanger', user=each)"
sclass="nicebutton"/>
</row>
</template>
</rows>
</grid>
<grid hflex="min">
<columns>
<column hflex="min"/>
<column hflex="min"/>
</columns>
<rows>
<row>
<label value="${labels.RequirementsFormVehicle}"/>
<combobox model="@load(vm.settings.vehicles)"
selectedItem="@bind(fx.vehicle)"
readonly="true">
<!-- Spolucestující -->
<groupbox
closable="false"
hflex="1"
vflex="min"
mold="3d">
<caption label="${labels.RequirementsFormPassengers}" />
<hlayout
hflex="1"
vflex="min">
<vlayout
hflex="1"
vflex="1">
<grid>
<columns>
<column hflex="min" />
<column />
</columns>
<rows>
<row>
<cell sclass="row-title">${labels.ChooseThePasseger} :</cell>
<cell>
<combobox
model="@load(vm.users)"
autocomplete="true"
selectedItem="@bind(vm.selUser)">
<template name="model">
<comboitem label="@load(each)" />
</template>
</combobox>
<button
label="${labels.Confirm}"
onClick="@command('addPassanger')"
sclass="nicebutton"
disabled="@load(vm.selUser eq null)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.ForeignPersons} :</cell>
<cell>
<textbox
id="foreignPersons"
hflex="1"
maxlength="@load(vm.lengthText)"
value="@bind(fx.foreignPersons)" />
</cell>
</row>
</rows>
</grid>
<checkbox
label="${labels.GenerateBillingForPassengers}"
checked="@bind(vm.dataBean.billForPassengers)"
disabled="@load(empty vm.passengers)" />
</vlayout>
<vlayout
hflex="1"
vflex="1">
<grid
model="@load(vm.passengers)"
sizedByContent="true"
hflex="1"
height="200px">
<columns>
<column hflex="10" />
<column hflex="min" />
<column hflex="1" />
</columns>
<rows>
<template name="model">
<comboitem label="@load(each)"/>
<row>
<label value="@load(each)" />
<button
label="${labels.RemoveItem}"
onClick="@command('removePassanger', user=each)"
sclass="nicebutton" />
</row>
</template>
</combobox>
</row>
<row>
<checkbox label="Požaduji zálohu" checked="@bind(vm.dataBean.requireDownPayment)"/>
<textbox
value="@bind(vm.dataBean.downPayment)"
maxlength="@load(vm.lengthText)"
disabled="@bind(not vm.dataBean.requireDownPayment)" />
</row>
</rows>
</grid>
</rows>
</grid>
</vlayout>
</hlayout>
</groupbox>
<!-- Způsob dopravy -->
<vbox
hflex="1"
vflex="min">
<groupbox
closable="false"
vflex="min"
hflex="1"
mold="3d">
<caption label="${labels.TransportMode}" />
<hbox>
<grid hflex="min">
<columns>
<column hflex="min" />
<column hflex="min" />
</columns>
<rows>
<row>
<label value="${labels.RequirementsFormVehicle}" />
<combobox
model="@load(vm.settings.vehicles)"
selectedItem="@bind(fx.vehicle)"
readonly="true">
<template name="model">
<comboitem label="@load(each)" />
</template>
</combobox>
</row>
<row>
<checkbox
label="Požaduji zálohu"
checked="@bind(vm.dataBean.requireDownPayment)" />
<textbox
value="@bind(vm.dataBean.downPayment)"
maxlength="@load(vm.lengthText)"
disabled="@bind(not vm.dataBean.requireDownPayment)" />
</row>
</rows>
</grid>
</hbox>
</groupbox>
</vbox>
<!-- Prázdný vbox = ostatní mají min. plochu a tento se roztahuje podle toho co zbyde. Když nic nezbyde, zobrazí se na min. plochou scrollbar a tohle není vidět -->
<vbox
hflex="1"
vflex="1">
</vbox>
<include src="/app/formButtons.zul" />
</vlayout>
<include
src="/app/formButtons.zul"
vflex="min" />
</window>
</zk>

@ -46,7 +46,7 @@
sclass="nicebutton"/>
<div visible="@load(not empty vm.bills)" vflex="1">
<separator bar="true" width="100%"/>
<label value="${labels.RequirementsFormPassengers}"/>
<label value="${labels.RequirementsFormPassengers}:"/>
<grid model="@load(vm.bills)" vflex="1">
<columns>
<column />

@ -49,7 +49,10 @@
<rows>
<row>
<label value="${labels.TripBillResultMessage}"/>
<datebox value="@bind(vm.dataBean.resultMessageDate)" disabled="${disabled}"/>
<datebox
value="@bind(vm.dataBean.resultMessageDate)"
disabled="${disabled}"
format="${labels.DateFormat}" />
</row>
<row>
<cell colspan="2">

Loading…
Cancel
Save