diff --git a/build.gradle b/build.gradle index 223277c..6159962 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { - ext.cubaVersion = '7.0.0' + ext.cubaVersion = '7.0.4' repositories { mavenLocal() @@ -167,7 +167,7 @@ configure(coreModule) { dbName = dbNameParam dbUser = 'sa' dbPassword = '' - } + } task updateDb(dependsOn: assembleDbScripts, description: 'Updates local database', type: CubaDbUpdate) { dbName = 'emailtemplates' @@ -176,7 +176,7 @@ configure(coreModule) { dbName = dbNameParam dbUser = 'sa' dbPassword = '' - } + } } configure(webModule) { diff --git a/modules/core/db/init/mssql/10.create-db.sql b/modules/core/db/init/mssql/10.create-db.sql new file mode 100644 index 0000000..0eb87cf --- /dev/null +++ b/modules/core/db/init/mssql/10.create-db.sql @@ -0,0 +1,93 @@ +-- begin EMAILTEMPLATES_PARAMETER_VALUE +create table EMAILTEMPLATES_PARAMETER_VALUE ( + ID uniqueidentifier, + VERSION integer not null, + CREATE_TS datetime2, + CREATED_BY varchar(50), + UPDATE_TS datetime2, + UPDATED_BY varchar(50), + DELETE_TS datetime2, + DELETED_BY varchar(50), + -- + PARAMETER_TYPE integer not null, + ALIAS varchar(255) not null, + DEFAULT_VALUE varchar(255), + TEMPLATE_PARAMETER_ID uniqueidentifier not null, + -- + primary key nonclustered (ID) +)^ +-- end EMAILTEMPLATES_PARAMETER_VALUE +-- begin EMAILTEMPLATES_TEMPLATE_GROUP +create table EMAILTEMPLATES_TEMPLATE_GROUP ( + ID uniqueidentifier, + VERSION integer not null, + CREATE_TS datetime2, + CREATED_BY varchar(50), + UPDATE_TS datetime2, + UPDATED_BY varchar(50), + DELETE_TS datetime2, + DELETED_BY varchar(50), + -- + NAME varchar(255) not null, + -- + primary key nonclustered (ID) +)^ +-- end EMAILTEMPLATES_TEMPLATE_GROUP +-- begin EMAILTEMPLATES_EMAIL_TEMPLATE +create table EMAILTEMPLATES_EMAIL_TEMPLATE ( + ID uniqueidentifier, + VERSION integer not null, + CREATE_TS datetime2, + CREATED_BY varchar(50), + UPDATE_TS datetime2, + UPDATED_BY varchar(50), + DELETE_TS datetime2, + DELETED_BY varchar(50), + DTYPE varchar(100), + -- + USE_REPORT_SUBJECT tinyint, + NAME varchar(255) not null, + GROUP_ID uniqueidentifier, + TYPE_ varchar(50) not null, + CODE varchar(255) not null, + FROM_ varchar(255), + TO_ varchar(max), + CC varchar(max), + BCC varchar(max), + SUBJECT varchar(255), + -- + -- from emailtemplates$ReportEmailTemplate + EMAIL_BODY_REPORT_ID uniqueidentifier, + -- + -- from emailtemplates$JsonEmailTemplate + HTML varchar(max), + REPORT_XML varchar(max), + -- + primary key nonclustered (ID) +)^ +-- end EMAILTEMPLATES_EMAIL_TEMPLATE +-- begin EMAILTEMPLATES_TEMPLATE_REPORT +create table EMAILTEMPLATES_TEMPLATE_REPORT ( + ID uniqueidentifier, + VERSION integer not null, + CREATE_TS datetime2, + CREATED_BY varchar(50), + UPDATE_TS datetime2, + UPDATED_BY varchar(50), + DELETE_TS datetime2, + DELETED_BY varchar(50), + -- + NAME varchar(255), + REPORT_ID uniqueidentifier not null, + EMAIL_TEMPLATE_ID uniqueidentifier, + -- + primary key nonclustered (ID) +)^ +-- end EMAILTEMPLATES_TEMPLATE_REPORT +-- begin EMAILTEMPLATES_EMLTPTE_FDLINK +create table EMAILTEMPLATES_EMLTPTE_FDLINK ( + EMAIL_TEMPLATE_ID uniqueidentifier, + FILE_DESCRIPTOR_ID uniqueidentifier, + primary key (EMAIL_TEMPLATE_ID, FILE_DESCRIPTOR_ID) +)^ +-- end EMAILTEMPLATES_EMLTPTE_FDLINK diff --git a/modules/core/db/init/mssql/20.create-db.sql b/modules/core/db/init/mssql/20.create-db.sql new file mode 100644 index 0000000..5167a53 --- /dev/null +++ b/modules/core/db/init/mssql/20.create-db.sql @@ -0,0 +1,20 @@ +-- begin EMAILTEMPLATES_PARAMETER_VALUE +alter table EMAILTEMPLATES_PARAMETER_VALUE add constraint FK_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER foreign key (TEMPLATE_PARAMETER_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ +create index IDX_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER on EMAILTEMPLATES_PARAMETER_VALUE (TEMPLATE_PARAMETER_ID)^ +-- end EMAILTEMPLATES_PARAMETER_VALUE +-- begin EMAILTEMPLATES_EMAIL_TEMPLATE +alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP foreign key (GROUP_ID) references EMAILTEMPLATES_TEMPLATE_GROUP(ID)^ +alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_EMAIL_BODY_REPORT foreign key (EMAIL_BODY_REPORT_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ +create unique index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_UNIQ_CODE on EMAILTEMPLATES_EMAIL_TEMPLATE (CODE, DELETE_TS) ^ +create index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP on EMAILTEMPLATES_EMAIL_TEMPLATE (GROUP_ID)^ +-- end EMAILTEMPLATES_EMAIL_TEMPLATE +-- begin EMAILTEMPLATES_TEMPLATE_REPORT +alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT foreign key (REPORT_ID) references REPORT_REPORT(ID)^ +alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ +create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT on EMAILTEMPLATES_TEMPLATE_REPORT (REPORT_ID)^ +create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE on EMAILTEMPLATES_TEMPLATE_REPORT (EMAIL_TEMPLATE_ID)^ +-- end EMAILTEMPLATES_TEMPLATE_REPORT +-- begin EMAILTEMPLATES_EMLTPTE_FDLINK +alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ +alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_FILE_DESCRIPTOR foreign key (FILE_DESCRIPTOR_ID) references SYS_FILE(ID)^ +-- end EMAILTEMPLATES_EMLTPTE_FDLINK diff --git a/modules/core/db/init/mssql/30.create-db.sql b/modules/core/db/init/mssql/30.create-db.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modules/core/db/init/mssql/30.create-db.sql @@ -0,0 +1 @@ + diff --git a/modules/core/db/init/mysql/10.create-db.sql b/modules/core/db/init/mysql/10.create-db.sql new file mode 100644 index 0000000..3ad1516 --- /dev/null +++ b/modules/core/db/init/mysql/10.create-db.sql @@ -0,0 +1,93 @@ +-- begin EMAILTEMPLATES_PARAMETER_VALUE +create table EMAILTEMPLATES_PARAMETER_VALUE ( + ID varchar(32), + VERSION integer not null, + CREATE_TS datetime(3), + CREATED_BY varchar(50), + UPDATE_TS datetime(3), + UPDATED_BY varchar(50), + DELETE_TS datetime(3), + DELETED_BY varchar(50), + -- + PARAMETER_TYPE integer not null, + ALIAS varchar(255) not null, + DEFAULT_VALUE varchar(255), + TEMPLATE_PARAMETER_ID varchar(32) not null, + -- + primary key (ID) +)^ +-- end EMAILTEMPLATES_PARAMETER_VALUE +-- begin EMAILTEMPLATES_TEMPLATE_GROUP +create table EMAILTEMPLATES_TEMPLATE_GROUP ( + ID varchar(32), + VERSION integer not null, + CREATE_TS datetime(3), + CREATED_BY varchar(50), + UPDATE_TS datetime(3), + UPDATED_BY varchar(50), + DELETE_TS datetime(3), + DELETED_BY varchar(50), + -- + NAME varchar(255) not null, + -- + primary key (ID) +)^ +-- end EMAILTEMPLATES_TEMPLATE_GROUP +-- begin EMAILTEMPLATES_EMAIL_TEMPLATE +create table EMAILTEMPLATES_EMAIL_TEMPLATE ( + ID varchar(32), + VERSION integer not null, + CREATE_TS datetime(3), + CREATED_BY varchar(50), + UPDATE_TS datetime(3), + UPDATED_BY varchar(50), + DELETE_TS datetime(3), + DELETED_BY varchar(50), + DTYPE varchar(100), + -- + USE_REPORT_SUBJECT boolean, + NAME varchar(255) not null, + GROUP_ID varchar(32), + TYPE_ varchar(50) not null, + CODE varchar(255) not null, + FROM_ varchar(255), + TO_ longtext, + CC longtext, + BCC longtext, + SUBJECT varchar(255), + -- + -- from emailtemplates$ReportEmailTemplate + EMAIL_BODY_REPORT_ID varchar(32), + -- + -- from emailtemplates$JsonEmailTemplate + HTML longtext, + REPORT_XML longtext, + -- + primary key (ID) +)^ +-- end EMAILTEMPLATES_EMAIL_TEMPLATE +-- begin EMAILTEMPLATES_TEMPLATE_REPORT +create table EMAILTEMPLATES_TEMPLATE_REPORT ( + ID varchar(32), + VERSION integer not null, + CREATE_TS datetime(3), + CREATED_BY varchar(50), + UPDATE_TS datetime(3), + UPDATED_BY varchar(50), + DELETE_TS datetime(3), + DELETED_BY varchar(50), + -- + NAME varchar(255), + REPORT_ID varchar(32) not null, + EMAIL_TEMPLATE_ID varchar(32), + -- + primary key (ID) +)^ +-- end EMAILTEMPLATES_TEMPLATE_REPORT +-- begin EMAILTEMPLATES_EMLTPTE_FDLINK +create table EMAILTEMPLATES_EMLTPTE_FDLINK ( + EMAIL_TEMPLATE_ID varchar(32), + FILE_DESCRIPTOR_ID varchar(32), + primary key (EMAIL_TEMPLATE_ID, FILE_DESCRIPTOR_ID) +)^ +-- end EMAILTEMPLATES_EMLTPTE_FDLINK diff --git a/modules/core/db/init/mysql/20.create-db.sql b/modules/core/db/init/mysql/20.create-db.sql new file mode 100644 index 0000000..13aaa76 --- /dev/null +++ b/modules/core/db/init/mysql/20.create-db.sql @@ -0,0 +1,20 @@ +-- begin EMAILTEMPLATES_PARAMETER_VALUE +alter table EMAILTEMPLATES_PARAMETER_VALUE add constraint FK_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER foreign key (TEMPLATE_PARAMETER_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ +create index IDX_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER on EMAILTEMPLATES_PARAMETER_VALUE (TEMPLATE_PARAMETER_ID)^ +-- end EMAILTEMPLATES_PARAMETER_VALUE +-- begin EMAILTEMPLATES_EMAIL_TEMPLATE +alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP foreign key (GROUP_ID) references EMAILTEMPLATES_TEMPLATE_GROUP(ID)^ +alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_EMAIL_BODY_REPORT foreign key (EMAIL_BODY_REPORT_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ +create unique index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_UNIQ_CODE on EMAILTEMPLATES_EMAIL_TEMPLATE (CODE) ^ +create index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP on EMAILTEMPLATES_EMAIL_TEMPLATE (GROUP_ID)^ +-- end EMAILTEMPLATES_EMAIL_TEMPLATE +-- begin EMAILTEMPLATES_TEMPLATE_REPORT +alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT foreign key (REPORT_ID) references REPORT_REPORT(ID)^ +alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ +create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT on EMAILTEMPLATES_TEMPLATE_REPORT (REPORT_ID)^ +create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE on EMAILTEMPLATES_TEMPLATE_REPORT (EMAIL_TEMPLATE_ID)^ +-- end EMAILTEMPLATES_TEMPLATE_REPORT +-- begin EMAILTEMPLATES_EMLTPTE_FDLINK +alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ +alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_FILE_DESCRIPTOR foreign key (FILE_DESCRIPTOR_ID) references SYS_FILE(ID)^ +-- end EMAILTEMPLATES_EMLTPTE_FDLINK diff --git a/modules/core/db/init/mysql/30.create-db.sql b/modules/core/db/init/mysql/30.create-db.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modules/core/db/init/mysql/30.create-db.sql @@ -0,0 +1 @@ + diff --git a/modules/core/src/com/haulmont/addon/emailtemplates/core/messages_ru.properties b/modules/core/src/com/haulmont/addon/emailtemplates/core/messages_ru.properties new file mode 100644 index 0000000..e69de29 diff --git a/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-browse.xml b/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-browse.xml index ab6e1c0..7d51bfb 100644 --- a/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-browse.xml +++ b/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-browse.xml @@ -26,8 +26,8 @@ - - + + diff --git a/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-edit.xml b/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-edit.xml index 21ca363..38bfcb0 100644 --- a/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-edit.xml +++ b/modules/web/src/com/haulmont/addon/emailtemplates/web/templategroup/template-group-edit.xml @@ -10,13 +10,13 @@ class="com.haulmont.addon.emailtemplates.entity.TemplateGroup" view="_local"/> - + - +