diff --git a/document/database/A5M2_knowledge.pdf b/document/database/A5M2_knowledge.pdf index 6b165d639..ac92566ce 100755 Binary files a/document/database/A5M2_knowledge.pdf and b/document/database/A5M2_knowledge.pdf differ diff --git a/document/database/knowledge.a5er b/document/database/knowledge.a5er index 43d5a658c..0f9b3befd 100755 --- a/document/database/knowledge.a5er +++ b/document/database/knowledge.a5er @@ -360,8 +360,8 @@ LName=認証トークン Comment= TableOption= Page=MAIN -Left=1600 -Top=50 +Left=3050 +Top=900 Field="TOKEN","TOKEN","@VARCHAR(128)","NOT NULL",0,"","",$FFFFFFFF,"" Field="ユーザID","USER_ID","@INT","NOT NULL",,"","",$FFFFFFFF,"" Field="有効期限","EXPIRES","@DATETIME","NOT NULL",,"","",$FFFFFFFF,"" @@ -370,7 +370,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20170620125822 -Position="MAIN",1600,50 +Position="MAIN",3050,900 [Relation] Entity1=MAIL_HOOKS @@ -823,7 +823,7 @@ Comment= TableOption= Page=MAIN Left=1600 -Top=400 +Top=350 Field="サービス名","SERVICE_NAME","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,"" Field="ロケールキー","LOCALE_KEY","@VARCHAR(12)","NOT NULL",1,"","",$FFFFFFFF,"" Field="トップページのHTML","PAGE_HTML","text",,,"","",$FFFFFFFF,"" @@ -831,7 +831,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20170130131057 -Position="MAIN",1600,400 +Position="MAIN",1600,350 [Entity] PName=SERVICE_CONFIGS @@ -840,7 +840,7 @@ Comment= TableOption= Page=MAIN Left=1600 -Top=200 +Top=100 Field="サービス名","SERVICE_NAME","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,"" Field="表示名","SERVICE_LABEL","@VARCHAR(24)","NOT NULL",,"","",$FFFFFFFF,"" Field="アイコン文字列","SERVICE_ICON","@VARCHAR(24)","NOT NULL",,"","",$FFFFFFFF,"" @@ -849,7 +849,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20170131001923 -Position="MAIN",1600,200 +Position="MAIN",1600,100 [Entity] PName=PINS @@ -1243,7 +1243,7 @@ Comment= TableOption= Page=MAIN Left=950 -Top=300 +Top=200 Field="テンプレートの種類ID","TYPE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" Field="選択肢番号","CHOICE_NO","@INT","NOT NULL",2,"","",$FFFFFFFF,"" @@ -1253,7 +1253,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150910041119 -Position="MAIN",950,300,542,135 +Position="MAIN",950,200,542,135 [Relation] Entity1=TEMPLATE_MASTERS @@ -1264,7 +1264,7 @@ Fields1=TYPE_ID Fields2=TYPE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4460,6903,3568,R,R +Position="MAIN",0,4460,6903,3717,R,R Dependence=1 Caption= PName= @@ -1272,7 +1272,7 @@ ModifiedDateTime=20150910034230 LineMode=0 Bar1=446 Bar2=690 -Bar3=357 +Bar3=372 TermPos1=R TermPos2=R @@ -1285,14 +1285,14 @@ Fields1=TYPE_ID Fields2=TYPE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,3334,5475,2219,R,R +Position="MAIN",0,3334,5475,2295,R,R Dependence=0 Caption= PName= LineMode=0 Bar1=333 Bar2=548 -Bar3=222 +Bar3=230 TermPos1=R TermPos2=R @@ -1308,10 +1308,11 @@ Field="テンプレートの種類ID","TYPE_ID","serial","NOT NULL",0,"","",$FFF Field="テンプレート名","TYPE_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" Field="アイコン","TYPE_ICON","@VARCHAR(64)",,,"","",$FFFFFFFF,"" Field="説明","DESCRIPTION","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" +Field="本文の初期値","INITIAL_VALUE","text",,,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20150912014311 +ModifiedDateTime=20170915171119 Position="MAIN",650,550 [Entity] @@ -1321,17 +1322,18 @@ Comment= TableOption= Page=MAIN Left=1350 -Top=550 +Top=500 Field="テンプレートの種類ID","TYPE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" Field="項目名","ITEM_NAME","@VARCHAR(32)","NOT NULL",,"","",$FFFFFFFF,"" Field="項目の種類","ITEM_TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,"" Field="説明","DESCRIPTION","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" +Field="初期値","INITIAL_VALUE","text",,,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20151027035632 -Position="MAIN",1350,550 +ModifiedDateTime=20170915171315 +Position="MAIN",1350,500 [Relation] Entity1=KNOWLEDGES @@ -1519,8 +1521,8 @@ LName=アカウントの画像 Comment= TableOption= Page=MAIN -Left=900 -Top=50 +Left=3550 +Top=1250 Field="IMAGE_ID","IMAGE_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ユーザID","USER_ID","@INT",,,"","",$FFFFFFFF,"" Field="ファイル名","FILE_NAME","@VARCHAR(256)",,,"","",$FFFFFFFF,"" @@ -1533,7 +1535,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416234339 -Position="MAIN",900,50 +Position="MAIN",3550,1250 [Relation] Entity1=KNOWLEDGES diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java index b1efca39d..c5b3678bd 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java @@ -219,6 +219,7 @@ public TemplateItemsEntity rawPhysicalInsert(TemplateItemsEntity entity) { entity.getItemName(), entity.getItemType(), entity.getDescription(), + entity.getInitialValue(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), @@ -241,6 +242,7 @@ public TemplateItemsEntity physicalInsert(TemplateItemsEntity entity) { entity.getItemName(), entity.getItemType(), entity.getDescription(), + entity.getInitialValue(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), @@ -288,6 +290,7 @@ public TemplateItemsEntity physicalUpdate(TemplateItemsEntity entity) { entity.getItemName(), entity.getItemType(), entity.getDescription(), + entity.getInitialValue(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java index dbce0f8ea..dcda456aa 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java @@ -176,6 +176,7 @@ public TemplateMastersEntity rawPhysicalInsert(TemplateMastersEntity entity) { entity.getTypeName(), entity.getTypeIcon(), entity.getDescription(), + entity.getInitialValue(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), @@ -207,6 +208,7 @@ public TemplateMastersEntity physicalInsert(TemplateMastersEntity entity) { entity.getTypeName(), entity.getTypeIcon(), entity.getDescription(), + entity.getInitialValue(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), @@ -255,6 +257,7 @@ public TemplateMastersEntity physicalUpdate(TemplateMastersEntity entity) { entity.getTypeName(), entity.getTypeIcon(), entity.getDescription(), + entity.getInitialValue(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), diff --git a/src/main/java/org/support/project/knowledge/deploy/InitDB.java b/src/main/java/org/support/project/knowledge/deploy/InitDB.java index e222e874b..92a71f12f 100644 --- a/src/main/java/org/support/project/knowledge/deploy/InitDB.java +++ b/src/main/java/org/support/project/knowledge/deploy/InitDB.java @@ -25,6 +25,7 @@ import org.support.project.knowledge.deploy.v1_11_0.Migrate_1_11_0; import org.support.project.knowledge.deploy.v1_11_0.Migrate_1_11_1; import org.support.project.knowledge.deploy.v1_11_0.Migrate_1_11_2; +import org.support.project.knowledge.deploy.v1_11_0.Migrate_1_11_3; import org.support.project.knowledge.deploy.v1_1_0pre1.Migrate_1_1_0pre1; import org.support.project.knowledge.deploy.v1_4_0.Migrate_1_4_0; import org.support.project.knowledge.deploy.v1_5_0.Migrate_1_5_0; @@ -50,7 +51,7 @@ public class InitDB { private static final Map MAP = new LinkedHashMap<>(); private static final Migrate INIT = InitializeSystem.get(); - public static final String CURRENT = "1.11.2"; + public static final String CURRENT = "1.11.3"; public InitDB() { super(); @@ -83,6 +84,7 @@ public InitDB() { MAP.put("1.11.0", Migrate_1_11_0.get()); MAP.put("1.11.1", Migrate_1_11_1.get()); MAP.put("1.11.2", Migrate_1_11_2.get()); + MAP.put("1.11.3", Migrate_1_11_3.get()); } public static void main(String[] args) throws Exception { diff --git a/src/main/java/org/support/project/knowledge/deploy/v1_11_0/Migrate_1_11_3.java b/src/main/java/org/support/project/knowledge/deploy/v1_11_0/Migrate_1_11_3.java new file mode 100644 index 000000000..b5a53023e --- /dev/null +++ b/src/main/java/org/support/project/knowledge/deploy/v1_11_0/Migrate_1_11_3.java @@ -0,0 +1,21 @@ +package org.support.project.knowledge.deploy.v1_11_0; + +import org.support.project.knowledge.deploy.Migrate; +import org.support.project.ormapping.tool.dao.InitializeDao; + +public class Migrate_1_11_3 implements Migrate { + + public static Migrate_1_11_3 get() { + return org.support.project.di.Container.getComp(Migrate_1_11_3.class); + } + + @Override + public boolean doMigrate() throws Exception { + InitializeDao initializeDao = InitializeDao.get(); + String[] sqlpaths = { + "/org/support/project/knowledge/deploy/v1_12/migrate_v1_12_0.sql", + }; + initializeDao.initializeDatabase(sqlpaths); + return true; + } +} \ No newline at end of file diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java index b5d0d95c5..6494ff8e7 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java @@ -61,6 +61,8 @@ public GenTemplateItemsEntity(Integer itemNo, Integer typeId) { private Integer itemType; /** 説明 */ private String description; + /** 初期値 */ + private String initialValue; /** 登録ユーザ */ private Integer insertUser; /** 登録日時 */ @@ -152,6 +154,22 @@ public GenTemplateItemsEntity setDescription(String description) { return this; } + /** + * Get 初期値. + * @return 初期値 + */ + public String getInitialValue() { + return this.initialValue; + } + /** + * Set 初期値. + * @param initialValue 初期値 + * @return this object */ + public GenTemplateItemsEntity setInitialValue(String initialValue) { + this.initialValue = initialValue; + return this; + } + /** * Get 登録ユーザ. * @return 登録ユーザ @@ -288,6 +306,7 @@ public String toString() { builder.append("itemName = ").append(itemName).append("\n"); builder.append("itemType = ").append(itemType).append("\n"); builder.append("description = ").append(description).append("\n"); + builder.append("initialValue = ").append(initialValue).append("\n"); builder.append("insertUser = ").append(insertUser).append("\n"); builder.append("insertDatetime = ").append(insertDatetime).append("\n"); builder.append("updateUser = ").append(updateUser).append("\n"); diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java index 97bbcb93c..fe0842458 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java @@ -57,6 +57,8 @@ public GenTemplateMastersEntity(Integer typeId) { private String typeIcon; /** 説明 */ private String description; + /** 本文の初期値 */ + private String initialValue; /** 登録ユーザ */ private Integer insertUser; /** 登録日時 */ @@ -132,6 +134,22 @@ public GenTemplateMastersEntity setDescription(String description) { return this; } + /** + * Get 本文の初期値. + * @return 本文の初期値 + */ + public String getInitialValue() { + return this.initialValue; + } + /** + * Set 本文の初期値. + * @param initialValue 本文の初期値 + * @return this object */ + public GenTemplateMastersEntity setInitialValue(String initialValue) { + this.initialValue = initialValue; + return this; + } + /** * Get 登録ユーザ. * @return 登録ユーザ @@ -264,6 +282,7 @@ public String toString() { builder.append("typeName = ").append(typeName).append("\n"); builder.append("typeIcon = ").append(typeIcon).append("\n"); builder.append("description = ").append(description).append("\n"); + builder.append("initialValue = ").append(initialValue).append("\n"); builder.append("insertUser = ").append(insertUser).append("\n"); builder.append("insertDatetime = ").append(insertDatetime).append("\n"); builder.append("updateUser = ").append(updateUser).append("\n"); diff --git a/src/main/java/org/support/project/knowledge/logic/TemplateLogic.java b/src/main/java/org/support/project/knowledge/logic/TemplateLogic.java index e8fb80b72..adfd95046 100644 --- a/src/main/java/org/support/project/knowledge/logic/TemplateLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/TemplateLogic.java @@ -155,6 +155,7 @@ public TemplateMastersEntity updateTemplate(TemplateMastersEntity template, Logi db.setTypeName(template.getTypeName()); db.setTypeIcon(template.getTypeIcon()); db.setDescription(template.getDescription()); + db.setInitialValue(template.getInitialValue()); templateDao.update(db); Integer typeId = template.getTypeId(); diff --git a/src/main/resources/appresource.properties b/src/main/resources/appresource.properties index 6ce949b2a..db6b7ecb7 100644 --- a/src/main/resources/appresource.properties +++ b/src/main/resources/appresource.properties @@ -694,6 +694,7 @@ knowledge.template.label.name=Name knowledge.template.label.icon=Icon knowledge.template.label.icon.msg=(Choice from 'Font Awesome'.[http://fontawesome.io/icons/] e.g. fa-book) knowledge.template.label.description=Description +knowledge.template.label.initial.value=Initial value knowledge.template.label.not.editable=This template is the default template of the system. you can edit only description. knowledge.template.msg.not.delete=The default template (knowledge, bookmark) can not be deleted. knowledge.template.label.item=Item diff --git a/src/main/resources/appresource_ja.properties b/src/main/resources/appresource_ja.properties index d346a4b3e..bd393a2f4 100644 --- a/src/main/resources/appresource_ja.properties +++ b/src/main/resources/appresource_ja.properties @@ -694,6 +694,7 @@ knowledge.template.label.name=名称 knowledge.template.label.icon=アイコン knowledge.template.label.icon.msg=(Font Awesome[http://fontawesome.io/icons/]から選択してください。 e.g. fa-book) knowledge.template.label.description=説明 +knowledge.template.label.initial.value=初期値 knowledge.template.label.not.editable=このテンプレートはシステムのデフォルトのテンプレートです。項目の増減、テンプレートの削除は出来ません。 knowledge.template.msg.not.delete=デフォルトのテンプレート(knowledge,bookmark)は削除できません knowledge.template.label.item=項目 diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql index 50cdf9dd6..de0c2c128 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql @@ -5,6 +5,7 @@ ITEM_NO , ITEM_NAME , ITEM_TYPE , DESCRIPTION + , INITIAL_VALUE , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -21,4 +22,5 @@ ITEM_NO , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql index 50cdf9dd6..de0c2c128 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql @@ -5,6 +5,7 @@ ITEM_NO , ITEM_NAME , ITEM_TYPE , DESCRIPTION + , INITIAL_VALUE , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -21,4 +22,5 @@ ITEM_NO , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql index 4f7f156e4..20cba5d01 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql @@ -3,6 +3,7 @@ SET ITEM_NAME = ? , ITEM_TYPE = ? , DESCRIPTION = ? + , INITIAL_VALUE = ? , INSERT_USER = ? , INSERT_DATETIME = ? , UPDATE_USER = ? diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql index 48ba4feaa..5ad1df82e 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql @@ -4,6 +4,7 @@ TYPE_ID , TYPE_NAME , TYPE_ICON , DESCRIPTION + , INITIAL_VALUE , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -19,4 +20,5 @@ DEFAULT , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql index 0c51f5ecc..ad00cad89 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql @@ -4,6 +4,7 @@ TYPE_ID , TYPE_NAME , TYPE_ICON , DESCRIPTION + , INITIAL_VALUE , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -19,4 +20,5 @@ TYPE_ID , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql index e3388f0f4..7f2ad83b6 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql @@ -3,6 +3,7 @@ SET TYPE_NAME = ? , TYPE_ICON = ? , DESCRIPTION = ? + , INITIAL_VALUE = ? , INSERT_USER = ? , INSERT_DATETIME = ? , UPDATE_USER = ? diff --git a/src/main/resources/org/support/project/knowledge/database/ddl.sql b/src/main/resources/org/support/project/knowledge/database/ddl.sql index 007e6a342..9b38d1985 100644 --- a/src/main/resources/org/support/project/knowledge/database/ddl.sql +++ b/src/main/resources/org/support/project/knowledge/database/ddl.sql @@ -527,6 +527,7 @@ create table TEMPLATE_MASTERS ( , TYPE_NAME character varying(256) not null , TYPE_ICON character varying(64) , DESCRIPTION character varying(1024) + , INITIAL_VALUE text , INSERT_USER integer , INSERT_DATETIME timestamp , UPDATE_USER integer @@ -544,6 +545,7 @@ create table TEMPLATE_ITEMS ( , ITEM_NAME character varying(32) not null , ITEM_TYPE integer not null , DESCRIPTION character varying(1024) + , INITIAL_VALUE text , INSERT_USER integer , INSERT_DATETIME timestamp , UPDATE_USER integer @@ -1210,6 +1212,7 @@ comment on column TEMPLATE_MASTERS.TYPE_ID is 'テンプレートの種類ID'; comment on column TEMPLATE_MASTERS.TYPE_NAME is 'テンプレート名'; comment on column TEMPLATE_MASTERS.TYPE_ICON is 'アイコン'; comment on column TEMPLATE_MASTERS.DESCRIPTION is '説明'; +comment on column TEMPLATE_MASTERS.INITIAL_VALUE is '本文の初期値'; comment on column TEMPLATE_MASTERS.INSERT_USER is '登録ユーザ'; comment on column TEMPLATE_MASTERS.INSERT_DATETIME is '登録日時'; comment on column TEMPLATE_MASTERS.UPDATE_USER is '更新ユーザ'; @@ -1222,6 +1225,7 @@ comment on column TEMPLATE_ITEMS.ITEM_NO is '項目NO'; comment on column TEMPLATE_ITEMS.ITEM_NAME is '項目名'; comment on column TEMPLATE_ITEMS.ITEM_TYPE is '項目の種類'; comment on column TEMPLATE_ITEMS.DESCRIPTION is '説明'; +comment on column TEMPLATE_ITEMS.INITIAL_VALUE is '初期値'; comment on column TEMPLATE_ITEMS.INSERT_USER is '登録ユーザ'; comment on column TEMPLATE_ITEMS.INSERT_DATETIME is '登録日時'; comment on column TEMPLATE_ITEMS.UPDATE_USER is '更新ユーザ'; diff --git a/src/main/resources/org/support/project/knowledge/deploy/v1_12/migrate_v1_12_0.sql b/src/main/resources/org/support/project/knowledge/deploy/v1_12/migrate_v1_12_0.sql new file mode 100644 index 000000000..f8fc68aab --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/deploy/v1_12/migrate_v1_12_0.sql @@ -0,0 +1,11 @@ +ALTER TABLE TEMPLATE_MASTERS DROP COLUMN IF EXISTS INITIAL_VALUE; +ALTER TABLE TEMPLATE_MASTERS ADD COLUMN INITIAL_VALUE text; + +comment on column TEMPLATE_MASTERS.INITIAL_VALUE is '本文の初期値'; + +ALTER TABLE TEMPLATE_ITEMS DROP COLUMN IF EXISTS INITIAL_VALUE; +ALTER TABLE TEMPLATE_ITEMS ADD COLUMN INITIAL_VALUE text; + +comment on column TEMPLATE_ITEMS.INITIAL_VALUE is '初期値'; + + diff --git a/src/main/webapp/WEB-INF/views/admin/template/edit.jsp b/src/main/webapp/WEB-INF/views/admin/template/edit.jsp index b4b6bc6c4..1973ea1e9 100644 --- a/src/main/webapp/WEB-INF/views/admin/template/edit.jsp +++ b/src/main/webapp/WEB-INF/views/admin/template/edit.jsp @@ -48,6 +48,10 @@ +
+ + +
<%= jspUtil.label("knowledge.template.label.item") %>
diff --git a/src/main/webapp/js/template-item-edit.js b/src/main/webapp/js/template-item-edit.js index a361a33c8..5864a6182 100644 --- a/src/main/webapp/js/template-item-edit.js +++ b/src/main/webapp/js/template-item-edit.js @@ -231,6 +231,7 @@ $(document).ready(function() { $('#typeName').val(result.typeName ? result.typeName : result.title); $('#typeIcon').val(result.typeIcon); $('#description').val(result.description); + $('#initialValue').val(result.initialValue); $('#deletebutton').removeClass('hide'); document._TEMPLATE.editable = result.editable; if (!result.editable) { diff --git a/src/main/webapp/js/template-item-input.js b/src/main/webapp/js/template-item-input.js index dde111141..1e334511c 100644 --- a/src/main/webapp/js/template-item-input.js +++ b/src/main/webapp/js/template-item-input.js @@ -122,12 +122,25 @@ $(document).ready(function() { tag += '
'; return tag; }; - + + var initialValue = ''; var addTemplateItem = function(template) { $('#template_msg').text(template.description); $('#template_info').removeClass('hide'); $('#template_info').addClass('show'); + var contentStr = $('#content').val(); + if (!contentStr) { + $('#content').val(template.initialValue); + initialValue = template.initialValue; + } else { + if (initialValue.replace(/\r?\n/g,"") == contentStr.replace(/\r?\n/g,"")) { + // 初期値を指定してから変更していない + $('#content').val(template.initialValue ? template.initialValue : ''); + initialValue = template.initialValue; + } + } + $('#template_items').html(''); var exists_date = false; var exists_time = false;