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 @@ + + + + + + String gridZul = "grid.zul"; + + + + + \ No newline at end of file