diff --git a/pom.xml b/pom.xml index b970de28a..c099e017f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.support-project knowledge war - 1.0.0-SNAPSHOT + 1.0.0 webapp for knowledge https://support-project.org/ @@ -16,7 +16,7 @@ org.support-project web - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/src/main/java/org/support/project/knowledge/bat/CreateExportDataBat.java b/src/main/java/org/support/project/knowledge/bat/CreateExportDataBat.java index 07706a10e..cafe4ef70 100644 --- a/src/main/java/org/support/project/knowledge/bat/CreateExportDataBat.java +++ b/src/main/java/org/support/project/knowledge/bat/CreateExportDataBat.java @@ -48,7 +48,6 @@ public static void main(String[] args) throws Exception { private void start() throws Exception { - super.dbInit(); SystemConfigsEntity entity = SystemConfigsDao.get().selectOnKey(SystemConfig.DATA_EXPORT, AppConfig.get().getSystemName()); if (entity == null) { send("[Fail] create fail. please try again."); diff --git a/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java b/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java index f3f10f1c5..8790b23ff 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java @@ -30,6 +30,7 @@ import org.support.project.knowledge.entity.TagsEntity; import org.support.project.knowledge.entity.TemplateItemsEntity; import org.support.project.knowledge.entity.TemplateMastersEntity; +import org.support.project.knowledge.logic.GroupLogic; import org.support.project.knowledge.logic.KnowledgeLogic; import org.support.project.knowledge.logic.TargetLogic; import org.support.project.knowledge.logic.UploadedFileLogic; @@ -43,6 +44,7 @@ import org.support.project.web.config.MessageStatus; import org.support.project.web.control.service.Get; import org.support.project.web.control.service.Post; +import org.support.project.web.entity.GroupsEntity; import org.support.project.web.exception.InvalidParamException; @DI(instance=Instance.Prototype) @@ -75,6 +77,21 @@ public Boundary view_add() { setAttribute("templates", templates); setAttribute("typeId", KnowledgeLogic.TEMPLATE_TYPE_KNOWLEDGE); + + // グループが指定されてる場合はデフォルトで公開範囲と共同編集者を選択済みにする + String groupId = super.getParam("group", String.class); + if (StringUtils.isNotEmpty(groupId)) { + GroupsEntity group = GroupLogic.get().getGroup(new Integer(groupId), getLoginedUser()); + if (group == null) { + return sendError(HttpStatus.SC_403_FORBIDDEN, ""); + } + + String[] groupIds = { TargetLogic.ID_PREFIX_GROUP + groupId }; + List targets = TargetLogic.get().selectTargets(groupIds); + setAttribute("publicFlag", KnowledgeLogic.PUBLIC_FLAG_PROTECT); + setAttribute("groups", targets); + setAttribute("editors", targets); + } return forward("view_add.jsp"); } diff --git a/src/main/java/org/support/project/knowledge/logic/GroupLogic.java b/src/main/java/org/support/project/knowledge/logic/GroupLogic.java index 06f1caf82..cfd91d885 100644 --- a/src/main/java/org/support/project/knowledge/logic/GroupLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/GroupLogic.java @@ -199,7 +199,9 @@ public GroupsEntity getGroup(Integer groupId, LoginedUser loginedUser) { group = groupsDao.selectAccessAbleGroup(groupId, loginedUser); } - setGroupStatus(group, loginedUser); + if (group != null) { + setGroupStatus(group, loginedUser); + } return group; } diff --git a/src/main/resources/appresource.properties b/src/main/resources/appresource.properties index 0b57066f3..3f9e8cd10 100644 --- a/src/main/resources/appresource.properties +++ b/src/main/resources/appresource.properties @@ -55,7 +55,7 @@ message.allready.started=Allready started. message.confirm.delete=Are you sure you want to delete? # Common Label -label.version=v1.0.0 pre2 +label.version=v1.0.0 label.login=Sign in label.previous = Previous label.next=Next diff --git a/src/main/resources/appresource_ja.properties b/src/main/resources/appresource_ja.properties index 03d2a8e59..6e7e9377f 100644 --- a/src/main/resources/appresource_ja.properties +++ b/src/main/resources/appresource_ja.properties @@ -55,7 +55,7 @@ message.allready.started=すでに開始済です message.confirm.delete=本当に削除しますか? # Common Label -label.version=v1.0.0 pre2 +label.version=v1.0.0 label.login=サインイン label.previous = 前へ label.next = 次へ diff --git a/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp b/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp index ab703ea7c..bb1fc3651 100644 --- a/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp +++ b/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp @@ -40,11 +40,11 @@ var _SET_IMAGE_LABEL= '<%= jspUtil.label("knowledge.edit.set.image.path") %>'; var _LABEL_UPDATE = '<%= jspUtil.label("label.update") %>'; var _UPDATE_TITLE = '<%= jspUtil.label("knowledge.edit.title") %>'; - -selectedGroups.push({label: '<%= jspUtil.out("group.label") %>', value: '<%= jspUtil.out("group.value") %>'}); + +selectedGroups.push({label: '<%= jspUtil.out("selectedGroup.label") %>', value: '<%= jspUtil.out("selectedGroup.value") %>'}); - -selectedEditors.push({label: '<%= jspUtil.out("editor.label") %>', value: '<%= jspUtil.out("editor.value") %>'}); + +selectedEditors.push({label: '<%= jspUtil.out("selectedEditor.label") %>', value: '<%= jspUtil.out("selectedEditor.value") %>'}); var _TAGS = [];