From ac90b0a2e3f95949327ab181c1eedd4a6375a4f1 Mon Sep 17 00:00:00 2001 From: Franta Pribyl Date: Thu, 19 Mar 2015 10:12:18 +0100 Subject: [PATCH] =?UTF-8?q?Formul=C3=A1=C5=99=20ag.=20Slu=C5=BEebn=C3=AD?= =?UTF-8?q?=20cesty=20/=20Aktu=C3=A1ln=C3=AD=20po=C5=BEadavky=20=E2=80=A2?= =?UTF-8?q?=20p=C5=99id=C3=A1no=20textov=C3=A9=20pole=20"Ciz=C3=AD=20osoby?= =?UTF-8?q?"=20=E2=80=A2=20upraven=20popisek=20formul=C3=A1=C5=99e=20?= =?UTF-8?q?=E2=80=A2=20upraven=20vzhled=20a=20zarovn=C3=A1n=C3=AD=20prvk?= =?UTF-8?q?=C5=AF=20=E2=80=A2=20p=C5=99id=C3=A1na=20kontrola=20ukazatele?= =?UTF-8?q?=20p=C5=99i=20promaz=C3=A1v=C3=A1n=C3=AD=20soubor=C5=AF=20na=20?= =?UTF-8?q?disku=20i=20v=20datab=C3=A1zi=20=E2=80=A2=20sjednocena=20maska?= =?UTF-8?q?=20pro=20form=C3=A1tov=C3=A1n=C3=AD=20data=20v=20=20cl?= =?UTF-8?q?oses=20#197?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukova/isspst/data/TripRequirement.java | 37 ++- .../storage/DocumentFileStorageImpl.java | 28 ++- .../WEB-INF/locales/zk-label.properties | 8 +- src/main/webapp/app/uploadComponents.zul | 57 +++-- src/main/webapp/main/approveDialog.zul | 4 +- .../webapp/main/invoicing/invoicingForm.zul | 1 + .../trips/requirements/requirementsForm.zul | 235 ++++++++++++------ .../trips/requirements/tripBillSummary.zul | 2 +- .../webapp/main/trips/tripBillInterior.zul | 5 +- 9 files changed, 264 insertions(+), 113 deletions(-) diff --git a/src/main/java/info/bukova/isspst/data/TripRequirement.java b/src/main/java/info/bukova/isspst/data/TripRequirement.java index d10ab802..d40af017 100644 --- a/src/main/java/info/bukova/isspst/data/TripRequirement.java +++ b/src/main/java/info/bukova/isspst/data/TripRequirement.java @@ -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 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; } diff --git a/src/main/java/info/bukova/isspst/storage/DocumentFileStorageImpl.java b/src/main/java/info/bukova/isspst/storage/DocumentFileStorageImpl.java index aea5e78c..9edc1ab9 100644 --- a/src/main/java/info/bukova/isspst/storage/DocumentFileStorageImpl.java +++ b/src/main/java/info/bukova/isspst/storage/DocumentFileStorageImpl.java @@ -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 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(); } } diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 95202f5f..fc15aa6b 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -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 diff --git a/src/main/webapp/app/uploadComponents.zul b/src/main/webapp/app/uploadComponents.zul index fafb5200..b8b6ec92 100644 --- a/src/main/webapp/app/uploadComponents.zul +++ b/src/main/webapp/app/uploadComponents.zul @@ -1,37 +1,54 @@ - - - - -