From c9a56887dc7c3566a8ab4c6d994ff1397a862bae Mon Sep 17 00:00:00 2001 From: Franta Pribyl Date: Thu, 4 Jun 2015 14:19:54 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99ipraveny=20podklady=20pro=20novou=20agen?= =?UTF-8?q?du=20"Podepsan=C3=A9=20dokumenty"=20Vzhled=20agendy=20(grid/str?= =?UTF-8?q?om/...)=20zat=C3=ADm=20nen=C3=AD=20zn=C3=A1m.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #222 --- .../java/info/bukova/isspst/Constants.java | 16 ++-- .../bukova/isspst/dao/SignedDocumentDao.java | 7 ++ .../isspst/dao/jpa/SignedDocumentDaoJPA.java | 9 ++ .../bukova/isspst/data/SignedDocument.java | 86 ++++++++++++++++++ .../isspst/data/SignedDocumentItem.java | 74 +++++++++++++++ .../info/bukova/isspst/reporting/Report.java | 46 ++++++++-- .../signeddocs/SignedDocumentService.java | 8 ++ .../signeddocs/SignedDocumentServiceImpl.java | 7 ++ src/main/resources/hibernate.cfg.xml | 2 + .../WEB-INF/locales/zk-label.properties | 3 +- .../webapp/WEB-INF/spring/root-context.xml | 7 ++ src/main/webapp/app/mainMenu.zul | 6 ++ src/main/webapp/img/adobe-016.png | Bin 0 -> 803 bytes src/main/webapp/img/adobe-032.png | Bin 0 -> 1439 bytes src/main/webapp/lists/signeddocs/index.zul | 10 ++ 15 files changed, 266 insertions(+), 15 deletions(-) create mode 100644 src/main/java/info/bukova/isspst/dao/SignedDocumentDao.java create mode 100644 src/main/java/info/bukova/isspst/dao/jpa/SignedDocumentDaoJPA.java create mode 100644 src/main/java/info/bukova/isspst/data/SignedDocument.java create mode 100644 src/main/java/info/bukova/isspst/data/SignedDocumentItem.java create mode 100644 src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentService.java create mode 100644 src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentServiceImpl.java create mode 100644 src/main/webapp/img/adobe-016.png create mode 100644 src/main/webapp/img/adobe-032.png create mode 100644 src/main/webapp/lists/signeddocs/index.zul diff --git a/src/main/java/info/bukova/isspst/Constants.java b/src/main/java/info/bukova/isspst/Constants.java index 6d8cabd3..e7fd3fb2 100644 --- a/src/main/java/info/bukova/isspst/Constants.java +++ b/src/main/java/info/bukova/isspst/Constants.java @@ -6,6 +6,7 @@ import info.bukova.isspst.data.PermissionType; import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.RequirementType; import info.bukova.isspst.data.Role; +import info.bukova.isspst.data.SignedDocument; import info.bukova.isspst.data.TripBill; import info.bukova.isspst.data.TripBillApproval; import info.bukova.isspst.data.TripRequirement; @@ -86,6 +87,7 @@ public class Constants { public final static String MOD_ORDER = "ORDER"; public final static String MOD_INVOICING = "INVOICING"; public final static String MOD_SEARCH = "SEARCH"; + public final static String MOD_SIGNEDDOCS = "SIGNEDDOCS"; public final static Module MODULES[] = { new Module(MOD_USERS, "Uživatelé", UserService.class), new Module(MOD_PERMISSIONS, "Práva", RoleService.class), @@ -103,6 +105,7 @@ public class Constants { new Module(MOD_ORDER, "Objednávky", OrderService.class), new Module(MOD_INVOICING, "Fakturace požadavků", InvoicingService.class), new Module(MOD_SEARCH, "Fulltextové vyhledávání", FullTextService.class, true, false), + new Module(MOD_SIGNEDDOCS, "Podepsané dokumenty", SignedDocument.class, true, false), }; public final static String PERM_APPROVE = "PERM_APPROVE"; @@ -130,16 +133,17 @@ public class Constants { new Permission(PERM_APPROVE, "Schválení", MOD_TRIPREQUIREMENTS, PermissionType.WORKGROUP), new Permission(PERM_SEARCH, "Vyhledávat", MOD_SEARCH, PermissionType.GLOBAL), + new Permission(PERM_READ, "Číst", MOD_SIGNEDDOCS, PermissionType.GLOBAL) }; public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava"; public final static ReportMapping REPORTS[] = { - new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresní karty", "address")), - new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresa", "address", false, true)), - new ReportMapping(MOD_TRIPBILL, new Report("Žádost", "tripRequirement", false, true)), - new ReportMapping(MOD_TRIPBILL, new Report("Vyúčtování", "tripBill", false, true, true)), - new ReportMapping(MOD_ORDER, new Report("Objednávka", "order", true, true)), - new ReportMapping(MOD_REQUIREMENTS, new Report("Požadavky", "requirements")) + new ReportMapping(MOD_ADDRESSBOOK, new Report(1, false, "Adresní karty", "address")), + new ReportMapping(MOD_ADDRESSBOOK, new Report(2, false, "Adresa", "address", false, true)), + new ReportMapping(MOD_TRIPBILL, new Report(3, true, "Žádost", "tripRequirement", false, true)), + new ReportMapping(MOD_TRIPBILL, new Report(4, true, "Vyúčtování", "tripBill", false, true, true)), + new ReportMapping(MOD_ORDER, new Report(5, false, "Objednávka", "order", true, true)), + new ReportMapping(MOD_REQUIREMENTS, new Report(6, false, "Požadavky", "requirements")) }; public final static String REQTYPE_ORDER = "ORDER"; diff --git a/src/main/java/info/bukova/isspst/dao/SignedDocumentDao.java b/src/main/java/info/bukova/isspst/dao/SignedDocumentDao.java new file mode 100644 index 00000000..15423a1c --- /dev/null +++ b/src/main/java/info/bukova/isspst/dao/SignedDocumentDao.java @@ -0,0 +1,7 @@ +package info.bukova.isspst.dao; + +import info.bukova.isspst.data.SignedDocument; + +public interface SignedDocumentDao extends BaseDao { + +} diff --git a/src/main/java/info/bukova/isspst/dao/jpa/SignedDocumentDaoJPA.java b/src/main/java/info/bukova/isspst/dao/jpa/SignedDocumentDaoJPA.java new file mode 100644 index 00000000..16e978b6 --- /dev/null +++ b/src/main/java/info/bukova/isspst/dao/jpa/SignedDocumentDaoJPA.java @@ -0,0 +1,9 @@ +package info.bukova.isspst.dao.jpa; + +import info.bukova.isspst.dao.SignedDocumentDao; +import info.bukova.isspst.data.SignedDocument; + +public class SignedDocumentDaoJPA extends BaseDaoJPA implements SignedDocumentDao { + + +} diff --git a/src/main/java/info/bukova/isspst/data/SignedDocument.java b/src/main/java/info/bukova/isspst/data/SignedDocument.java new file mode 100644 index 00000000..a0575882 --- /dev/null +++ b/src/main/java/info/bukova/isspst/data/SignedDocument.java @@ -0,0 +1,86 @@ +package info.bukova.isspst.data; + +import info.bukova.isspst.Constants; +import info.bukova.isspst.Module; +import info.bukova.isspst.StringUtils; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "SIGNED_DOCUMENTS") +public class SignedDocument extends BaseData { + + @Column(name = "MODULE_NAME", length = Constants.LEN_TEXT) + private String moduleName; + + @Column(name = "RECORD_ID") + private int recordId; + + @Column(name = "NUMSER", length = Constants.LEN_TEXT) + private String numser; + + @Column(name = "DESCRIPTION", length = Constants.LEN_DESCRIPTION) + private String description; + + @Column(name = "SIGN_DATE") + private Date signDate; + + public String getModuleName() { + return moduleName; + } + + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public String getNumser() { + return numser; + } + + public void setNumser(String numser) { + this.numser = numser; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getSignDate() { + return signDate; + } + + public void setSignDate(Date signDate) { + this.signDate = signDate; + } + + public String getAgendaName() { + + if (StringUtils.isNullOrEmpty(this.moduleName)) { + return ""; + } + + for (Module m : Constants.MODULES) { + if (m.getId() == this.moduleName) { + return m.getName(); + } + } + + return ""; + } +} diff --git a/src/main/java/info/bukova/isspst/data/SignedDocumentItem.java b/src/main/java/info/bukova/isspst/data/SignedDocumentItem.java new file mode 100644 index 00000000..e76d507c --- /dev/null +++ b/src/main/java/info/bukova/isspst/data/SignedDocumentItem.java @@ -0,0 +1,74 @@ +package info.bukova.isspst.data; + +import info.bukova.isspst.Constants; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "SIGNED_DOCUMENTS_ITEMS") +public class SignedDocumentItem { + + @Id + @Column(name = "ID") + @GeneratedValue + private int id; + + @Column(name = "REPORT_ID") + private int reportId; + + @Column(name = "REPORT_NAME", length = Constants.LEN_TEXT) + private String reportName; + + @Column(name = "FILENAME", length = Constants.LEN_TEXT) + private String fileName; + + @ManyToOne + @JoinColumn(name = "SIGNED_DOCUMENT_ID") + private SignedDocument signedDocument; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getReportId() { + return reportId; + } + + public void setReportId(int reportId) { + this.reportId = reportId; + } + + public String getReportName() { + return reportName; + } + + public void setReportName(String reportName) { + this.reportName = reportName; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public SignedDocument getSignedDocument() { + return signedDocument; + } + + public void setSignedDocument(SignedDocument signedDocument) { + this.signedDocument = signedDocument; + } +} diff --git a/src/main/java/info/bukova/isspst/reporting/Report.java b/src/main/java/info/bukova/isspst/reporting/Report.java index 606626b9..89875d6d 100644 --- a/src/main/java/info/bukova/isspst/reporting/Report.java +++ b/src/main/java/info/bukova/isspst/reporting/Report.java @@ -4,6 +4,8 @@ package info.bukova.isspst.reporting; public class Report { private ReportType type; + private long reportId; + private boolean signable; private String name; private String jasperFile; private boolean hasSettings; @@ -11,53 +13,65 @@ public class Report { private boolean hasCondition; public Report() { + this.reportId = 0; + this.signable = false; hasSettings = false; singleRecord = false; hasCondition = false; } /** + * @param reportId + * @param signable * @param name * @param jasperFile */ - public Report(String name, String jasperFile) { + public Report(long reportId, boolean signable, String name, String jasperFile) { this(); this.type = ReportType.DEFINED; + this.reportId = reportId; + this.signable = signable; this.name = name; this.jasperFile = jasperFile; } /** + * @param reportId + * @param signable * @param name * @param jasperFile * @param hasSettings */ - public Report(String name, String jasperFile, boolean hasSettings) { - this(name, jasperFile); + public Report(long reportId, boolean signable, String name, String jasperFile, boolean hasSettings) { + this(reportId, signable, name, jasperFile); this.hasSettings = hasSettings; } /** + * @param reportId + * @param signable * @param name * @param jasperFile * @param hasSettings * @param singleRecord */ - public Report(String name, String jasperFile, boolean hasSettings, boolean singleRecord) { - this(name, jasperFile, hasSettings); + public Report(long reportId, boolean signable, String name, String jasperFile, boolean hasSettings, boolean singleRecord) { + this(reportId, signable, name, jasperFile, hasSettings); this.singleRecord = singleRecord; } /** - * + * + * @param reportId + * @param signable * @param name * @param jasperFile * @param hasSettings * @param singleRecord * @param hasCondition */ - public Report(String name, String jasperFile, boolean hasSettings, boolean singleRecord, boolean hasCondition) { - this(name, jasperFile, hasSettings, singleRecord); + public Report(long reportId, boolean signable, String name, String jasperFile, boolean hasSettings, boolean singleRecord, boolean hasCondition) { + this(reportId, signable, name, jasperFile, hasSettings, singleRecord); this.hasCondition = hasCondition; } @@ -108,4 +122,20 @@ public class Report { public void setHasCondition(boolean hasCondition) { this.hasCondition = hasCondition; } + + public long getReportId() { + return reportId; + } + + public void setReportId(long reportId) { + this.reportId = reportId; + } + + public boolean isSignable() { + return signable; + } + + public void setSignable(boolean signable) { + this.signable = signable; + } } diff --git a/src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentService.java b/src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentService.java new file mode 100644 index 00000000..51d74732 --- /dev/null +++ b/src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentService.java @@ -0,0 +1,8 @@ +package info.bukova.isspst.services.signeddocs; + +import info.bukova.isspst.data.SignedDocument; +import info.bukova.isspst.services.Service; + +public interface SignedDocumentService extends Service { + +} diff --git a/src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentServiceImpl.java b/src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentServiceImpl.java new file mode 100644 index 00000000..7582c7b0 --- /dev/null +++ b/src/main/java/info/bukova/isspst/services/signeddocs/SignedDocumentServiceImpl.java @@ -0,0 +1,7 @@ +package info.bukova.isspst.services.signeddocs; + +import info.bukova.isspst.data.SignedDocument; +import info.bukova.isspst.services.AbstractOwnedService; + +public class SignedDocumentServiceImpl extends AbstractOwnedService implements SignedDocumentService { +} diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml index 5cf14ec5..1ad512cf 100644 --- a/src/main/resources/hibernate.cfg.xml +++ b/src/main/resources/hibernate.cfg.xml @@ -36,5 +36,7 @@ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index a800620e..82d6377e 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -1,5 +1,6 @@ # Default file -AppName=Objednávkový systém SPŠ Třebíč +AppName=Informační systém SPŠ Třebíč +AgendaSignedDocuments=Podepsané dokumenty AgendaActRequirements=Aktuální požadavky AgendaRequirementsHistory=Ukončené požadavky diff --git a/src/main/webapp/WEB-INF/spring/root-context.xml b/src/main/webapp/WEB-INF/spring/root-context.xml index b97b8ec8..f95f7678 100644 --- a/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/src/main/webapp/WEB-INF/spring/root-context.xml @@ -272,6 +272,10 @@ + + + + @@ -453,4 +457,7 @@ + + + diff --git a/src/main/webapp/app/mainMenu.zul b/src/main/webapp/app/mainMenu.zul index 75b2aaf7..93135908 100644 --- a/src/main/webapp/app/mainMenu.zul +++ b/src/main/webapp/app/mainMenu.zul @@ -61,6 +61,12 @@ + + Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;VI^GGzb&0+dNaK~y+Tb(2YGQ&AL#FA6qI(pIpGB1PN? z;>wNSs>R|?l!8h(f}%JeMH~XgnV8a5|m4W%Fi{OeT%9 zv$J5$&CPA7P$c%Mil7*g{4{YT2S z-@$;2abaNri;IhLJuomJ_pEF-3y;SG0{pbw?fc8t^{4>YxU{q+RVtNWGMVHAoagCy zs+pM?_gp;ehiEh^ z0rWPck$d77Pv!BA?H10AjJ&<^V48 z!*VzrvYBB#5!blqAAnV_X;M$0`k3f4BGzfdhxW@DzkU^oo-QOGbR*f*E!XkxPQ<8Z zs`EY~MguIZ$IQL@ZTrM4y~h8kP6r>Wp&noR9wAMQ>cIo}()$ppyB!GZ+9~rX!#(&L z8{n$dVYEhz9&OcYF{0Nf3!!J7X%om4JQ=>d^ejAIn;zOO^~6{r}=g+oI`fxCDgrpB!K0hDW2*yX3?+J zyn9Rt{rty4!6j>tP#LT*C)EF=b~8%{rjPzXHk0c zQ(l($Kk|Tkq8_)DwZGrcC`2{Ch^=n7yM1zU(iIAYe8FJwGes~E2&jLGzC49%^y_=+ h1Dl}VyG;nOS literal 0 HcmV?d00001 diff --git a/src/main/webapp/img/adobe-032.png b/src/main/webapp/img/adobe-032.png new file mode 100644 index 0000000000000000000000000000000000000000..3d600e50960b49ccaa80da8c7a5774bc427c3ce5 GIT binary patch literal 1439 zcmV;Q1z`G#P)pF&ENXxSNbX|Wflga#i^5n_B z>jH2!KxJ_phio>B5CTopux*>x)>drW?n$T9r$$)|=6AFc}ZJSUi)YRPEbUYS|b*-2I zKZwQ8<(5n)DHe-0-{`tdb8|DU>kqtR$h!po|GdTnZI zioU)+Mn^~SJg>4Y`0dJK7zVAatzG-~@9$j^14|WQE|y+HvUf`AZc3-GLsx6|_UGoZlBq)8n62zNeB z_`vf3c-bte&p*Q%`-RY>k73_=S0(U2hu$Lp*AylYP#`4aJY}VndK8F(Zyj*`bS!j8 z!0hg(`TpHFXNED_!rbz~hZr~AM9bq(;>3ng$s}tBj$?L3XxzR7BYZQ?@DR@M5Tr9` z0(2oT1=t8|0m2uzst85RwRHD#4o*Cd(bKgUNfY9Pz9T8%vHG8VGcDVQt>R#W!BZ zxb-&DKMeBstFKf6EGJy{=O5|{fC7q)5?CmND9r$Yz;zr7Gc$NTBezhXFgwe-(`QhQ z!^L;rCLJH8anA#|sZ`as^#Evf`gq4SPc#X!HzWj&0!+m6cB*TL5T$?yrKx?mMENU6U3nLj#((6~Pv1Oo;_I(Y z72KgKo)^i)#KiH=&d$o8(c*3Onjn@~o|RIZJ$v?%{{H?i{QA0k!S$^1E43{HD6c!l z;lqay+P3|k<2Xh(n>F(JyiqI`b=P&JQc8NBCzVpN9L#rC@D@(Ro|MwlG_7bDM&7cl tylvZg+qU!L + + + + String gridZul = "grid.zul"; + + + + + \ No newline at end of file