From 4356da2b030443f74c25335ad60b9f3c40f5b789 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 수, 15 12월 2021 09:55:54 +0900 Subject: [PATCH] 이슈 하위이슈 삭제버튼, 최고관리자인데 수정 권한이 없는 오류 수정 --- src/main/webapp/scripts/app/issue/issueDetail.controller.js | 707 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 600 insertions(+), 107 deletions(-) diff --git a/src/main/webapp/scripts/app/issue/issueDetail.controller.js b/src/main/webapp/scripts/app/issue/issueDetail.controller.js index 32157d2..15203d4 100644 --- a/src/main/webapp/scripts/app/issue/issueDetail.controller.js +++ b/src/main/webapp/scripts/app/issue/issueDetail.controller.js @@ -8,12 +8,15 @@ 'angular' ], function (app, angular) { - app.controller('issueDetailController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$tableProvider', '$state', '$uibModal', 'SweetAlert', '$timeout', 'Issue', 'IssueComment', 'IssueRelation', 'AttachedFile', 'IssueStatus', '$filter', - function ($scope, $rootScope, $log, $resourceProvider, $tableProvider, $state, $uibModal, SweetAlert, $timeout, Issue, IssueComment, IssueRelation, AttachedFile, IssueStatus, $filter) { + app.controller('issueDetailController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$tableProvider', '$state', '$uibModal', '$q', + '$controller', '$injector', 'SweetAlert', '$timeout', 'Issue', 'IssueComment', 'IssueRelation', 'AttachedFile', 'Priority', 'Severity','IssueStatus', 'IssueTableConfig', '$filter', + function ($scope, $rootScope, $log, $resourceProvider, $tableProvider, $state, $uibModal, $q, $controller, $injector, SweetAlert, $timeout, Issue, IssueComment, IssueRelation, AttachedFile, Priority, Severity, IssueStatus, IssueTableConfig, $filter) { // IssueListController vm, fn 蹂��닔 �긽�냽. $scope.fn.getIssueDetail = getIssueDetail; // �씠�뒋 �긽�꽭 �젙蹂� 媛��졇�삤湲� + $scope.fn.setRelTableColumn = setRelTableColumn; + $scope.fn.setDownTableColumn = setDownTableColumn; $scope.fn.addComment = addComment; // �뙎湲� �벑濡� $scope.fn.removeComment = removeComment; // �뙎湲� �궘�젣 $scope.fn.getCommentList = getCommentList; // �뙎湲� 紐⑸줉 媛��졇�삤湲� @@ -25,19 +28,32 @@ $scope.fn.updateActiveHistory = updateActiveHistory; // �솢�룞 �궡�뿭�뿉�꽌 �쟾泥� 蹂닿린 �꺆�쓣 �닃���쓣 �븣 �뙎湲�, 湲곕줉 �젙蹂대�� �뾽�뜲�씠�듃 �븳�떎. $scope.fn.getChangeIssueStatusList = getChangeIssueStatusList; // �씠�뒋�쓽 �쁽�옱 �긽�깭�뿉�꽌 蹂�寃� 媛��뒫�븳 �씠�뒋 �깄�깭 紐⑸줉 媛��졇�삤湲� $scope.fn.modifyIssueStatus = modifyIssueStatus; // �씠�뒋 �긽�깭 蹂�寃� + $scope.fn.modifyDownIssueStatus = modifyDownIssueStatus; //�븯�쐞 �씠�뒋 �긽�깭 蹂�寃� $scope.fn.modifyIssueUser = modifyIssueUser; // �씠�뒋 �떞�떦�옄 蹂�寃� $scope.fn.modifyIssueDepartment = modifyIssueDepartment; // �씠�뒋 �떞�떦遺��꽌 蹂�寃� $scope.fn.initReload = initReload; // 珥덇린�솕 �빐�빞�븷 �븷紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. - $scope.fn.sendMail = sendMail; // �듅�젙 �궗�슜�옄�뿉寃� �씠�뒋 �젙蹂대�� 硫붿씪濡� 諛쒖넚 + $scope.fn.sendMail = sendMail; + $scope.fn.sendMailAll = sendMailAll; + $scope.fn.sendMailVo = sendMailVo; + $scope.fn.getParameters = getParameters; + $scope.fn.getParametersAll = getParametersAll; + // �듅�젙 �궗�슜�옄�뿉寃� �씠�뒋 �젙蹂대�� 硫붿씪濡� 諛쒖넚 $scope.fn.versionView = versionView; // 踰꾩쟾 �젙蹂대�� �몴�떆�븳�떎. $scope.fn.reservation = reservation; // �삁�빟 �젙蹂대�� �솗�씤 諛� 蹂�寃� �븳�떎. $scope.fn.getIssueListCallBack = getIssueListCallBack; + $scope.fn.getDownIssueListCallBack = getDownIssueListCallBack; $scope.fn.addRelationIssue = addRelationIssue; // �뿰愿� �씠�뒋 異붽� $scope.fn.addDownIssue = addDownIssue; // �븯�쐞 �씠�뒋 異붽� - + $scope.fn.addRelationIssueTableConfig = addRelationIssueTableConfig; // �뿰愿� �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 + $scope.fn.addDownIssueTableConfig = addDownIssueTableConfig; // �븯�쐞 �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 + $scope.fn.setRelTableConfigs = setRelTableConfigs; + $scope.fn.setDownTableConfigs = setDownTableConfigs; + $scope.fn.containsPartner = containsPartner; + $scope.fn.onActivate = onActivate; + $scope.fn.issueBack = issueBack; // �씠�뒋 紐⑸줉 而⑦듃濡ㅻ윭 vm, fn �긽�냽 以� - $scope.vm.viewer = {}; + $scope.vm.viewer = {}; // �쁽�옱 �씠�뒋 $scope.vm.images = []; // 泥⑤��맂 �뙆�씪 以� �씠誘몄� �뙆�씪 $scope.vm.activeTab = "ALL"; // �솢�룞 �궡�뿭 �꺆 // �씠�뒋 �긽�깭 蹂�寃� �몴�떆 �뿬遺� @@ -64,7 +80,10 @@ $scope.vm.form = { issues : [], //�뿰愿� �씪媛� - issuesDown : [] // �븯�쐞 �씪媛� + issuesDown : [], // �븯�쐞 �씪媛� + issueCompanyVos : [], + issueIspVos : [], + issueHostingVos : [] }; @@ -77,6 +96,8 @@ }; $scope.vm.issueName = ""; // �꽑�깮�맂 �뿰愿� �씪媛� �씠由� + $scope.vm.issueId = ""; // + $scope.vm.issueTypeId = ""; $scope.vm.autoCompletePage = { issue : { page : 0, @@ -102,15 +123,33 @@ function changeDetailView(issue) { // �씠�뒋 踰덊샇瑜� ���옣�븳 �썑 �씠�뒋 紐⑸줉�쑝濡� �씠�룞�븳�떎. - // $rootScope.$broadcast("makeIssueSearch", issue); + //$rootScope.$broadcast("makeIssueSearch",issue); $scope.$parent.tableEvent.changeDetailView(issue.id); + $scope.fn.onActivate(); } - // �븯�쐞 �씪媛� �궘�젣 + // �긽�쐞 �씠�뒋 �겢由��떆 �긽�쐞 �씠�뒋濡� �씠�룞 + function issueBack() { + $rootScope.currentDetailIssueId = $scope.vm.viewer.parentIssueVo.id + $rootScope.$broadcast("getIssueDetail", {id: $rootScope.currentDetailIssueId}); + } + + function onActivate() { + window.scroll(0,240); + } + + angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); + + // �씠�뒋 紐⑸줉 �뜲�씠�꽣 媛깆떊 + $scope.$on("getIssueList", function () { + $scope.fn.getIssueDetail(); + }); + + // �븯�쐞 �씠�뒋 �궘�젣 function removeDownIssue(id) { // �궘�젣 �븣由� SweetAlert.swal({ - title : $filter("translate")("issue.downIssueRemove"), // �뿰愿� �씪媛� �궘�젣 + title : $filter("translate")("issue.downIssueRemove"), // �븯�쐞 �씠�뒋 �궘�젣 text : $filter("translate")("issue.wantToDeleteSelectIssue"), type : "warning", showCancelButton : true, @@ -148,11 +187,11 @@ } - // �뿰愿� �씪媛� �궘�젣 + // �뿰愿� �씠�뒋 �궘�젣 function removeRelationIssue(id) { // �궘�젣 �븣由� SweetAlert.swal({ - title : $filter("translate")("issue.relationIssueRemove"), // �뿰愿� �씪媛� �궘�젣 + title : $filter("translate")("issue.relationIssueRemove"), // �뿰愿� �씠�뒋 �궘�젣 text : $filter("translate")("issue.wantToDeleteSelectIssue"), type : "warning", showCancelButton : true, @@ -195,66 +234,392 @@ $scope.vm.autoCompletePage.issue.totalPage = result.data.page.totalPage; } - // �븯�쐞 �씠�뒋 �뀒�씠釉� �꽕�젙 - function makeTableConfigsDown() { - $scope.vm.downTableConfigs = []; - $scope.vm.downTableConfigs.push($tableProvider.config() - .setHName("issue.downIssueTitle") - .setDType("renderer") - .setHWidth("width-60 bold") - .setHSort(false) - .setDRenderer("ISSUE_DOWN_MOVE")) - $scope.vm.downTableConfigs.push($tableProvider.config() - .setHName("issue.relationIssueDelete") - .setDType("renderer") - .setHWidth("width-10 bold") - .setDRenderer("ISSUE_DOWN_DELETE") - .setHSort(false) - .setDAlign("text-center")) + function getDownIssueListCallBack(result) { + $scope.vm.autoCompletePage.issue.totalPage = result.data.page.totalPage; } + // �뀒�씠釉붿쓽 �뿰愿� �씠�뒋 而щ읆�쓣 留뚮뱾�뼱以��떎. + function setRelTableColumn(Rel_issueTableConfig) { + + // �뿰愿� �씠�뒋 而щ읆 + switch(Rel_issueTableConfig.key) { + + // �뿰愿� �씠�뒋 援щ텇 + case "RELATION_ISSUE_TYPE" : + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueType") + .setDType("renderer") + .setHWidth("width-30 bold") + .setHSort(false) + .setDRenderer("ISSUE_RELATION_TYPE")) + break; + // �뿰愿� �씠�뒋 �젣紐� + case "RELATION_ISSUE_TITLE" : + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueTitle") + .setDType("renderer") + .setHWidth("width-60 bold") + .setHSort(false) + .setDRenderer("ISSUE_RELATION_MOVE")) + break; + case "PRIORITY" : // �뿰愿� �씠�뒋 �슦�꽑�닚�쐞 + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.priority") + .setDName("priorityName") + .setDType("renderer") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_COMMON_PRIORITY")); + break; + case "SEVERITY" : // �뿰愿� �씠�뒋 以묒슂�룄 + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.importance") + .setDName("severityName") + .setDType("renderer") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_COMMON_SEVERITY")); + break; + case "ASSIGNEE_TEAM" : // �뿰愿� �씠�뒋 �떞�떦遺��꽌 + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.assigneeTeam") + .setDType("renderer") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_ISSUE_DEPARTMENT")); + break; + + case "REGISTER" : // �뿰愿� �씠�뒋 �벑濡앹옄 + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.register") + .setDType("renderer") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_REGISTER")); + break; + case "PERIOD" : // �뿰愿� �씠�뒋 湲곌컙 + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.period") + .setDType("renderer") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_ISSUE_DUE_DATE")); + break; + case "MODIFY_DATE" : // �뿰愿� �씠�뒋 理쒓렐 蹂�寃쎌씪 + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.lastChangeDate") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setDName("modifyDate")); + break; + } + + // �궗�슜�옄 �젙�쓽 �븘�뱶 而щ읆 + if (Rel_issueTableConfig.key.indexOf("CUSTOM_FIELD_") !== -1) { + // 留뚯빟 �씠�뒋 �뀒�씠釉� 而щ읆紐낆씠 �몴�떆�릺吏� �븡�쑝硫� �씠履쎌씠 臾몄젣 + for (var count in $scope.vm.customFields) { + var customField = $scope.vm.customFields[count]; + + if (customField.id === Number(Rel_issueTableConfig.key.substring(13))) { + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName(customField.name) + .setDType("renderer") + .setHWidth("bold " + Rel_issueTableConfig.width) + .setDAlign("text-center") + .setColumnHint(customField) + .setDRenderer("REL_ISSUE_CUSTOM_FIELD_VALUE_VIEW")); + break; + } + } + } + } + + + // �뀒�씠釉붿쓽 �븯�쐞 �씠�뒋 而щ읆�쓣 留뚮뱾�뼱以��떎. + function setDownTableColumn(Down_issueTableConfig) { + // if (issueTableConfig == null) return; + + // �븯�쐞 �씠�뒋 而щ읆 + switch(Down_issueTableConfig.key) { + // �븯�쐞 �씠�뒋 �젣紐� + case "DOWN_ISSUE_TITLE" : + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("issue.downIssueTitle") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("ISSUE_DOWN_MOVE")); + break; + + case "ISSUE_DOWN_STATUS_TYPE" : // �씠�뒋 �긽�깭 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("issue.issueStatus") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("ISSUE_DOWN_STATUS_TYPE")); + break; + + case "PRIORITY" : // �븯�쐞 �씠�뒋 �슦�꽑�닚�쐞 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.priority") + .setDName("priorityName") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_COMMON_PRIORITY")); + break; + case "SEVERITY" : // 以묒슂�룄 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.importance") + .setDName("severityName") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_COMMON_SEVERITY")); + break; + case "ASSIGNEE_TEAM" : // �떞�떦遺��꽌 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.assigneeTeam") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_ISSUE_DEPARTMENT")); + break; + case "REGISTER" : // �벑濡앹옄 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.register") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_REGISTER")); + break; + case "PERIOD" : // 湲곌컙 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.period") + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_ISSUE_DUE_DATE")); + break; + case "MODIFY_DATE" : // 理쒓렐 蹂�寃쎌씪 + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.lastChangeDate") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setDName("modifyDate")); + break; + } + + // �궗�슜�옄 �젙�쓽 �븘�뱶 而щ읆 + if (Down_issueTableConfig.key.indexOf("CUSTOM_FIELD_") !== -1) { + // 留뚯빟 �씠�뒋 �뀒�씠釉� 而щ읆紐낆씠 �몴�떆�릺吏� �븡�쑝硫� �씠履쎌씠 臾몄젣 + for (var count in $scope.vm.customFields) { + var customField = $scope.vm.customFields[count]; + + if (customField.id === Number(Down_issueTableConfig.key.substring(13))) { + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName(customField.name) + .setDType("renderer") + .setHWidth("bold " + Down_issueTableConfig.width) + .setDAlign("text-center") + .setColumnHint(customField) + .setDRenderer("DOWN_ISSUE_CUSTOM_FIELD_VALUE_VIEW")); + break; + } + } + } + } + + // �뿰愿� �씠�뒋 �뀒�씠釉� �꽕�젙 - function makeTableConfigs() { + function makeRelTableConfigs() { $scope.vm.relTableConfigs = []; $scope.vm.relTableConfigs.push($tableProvider.config() .setHName("issue.relationIssueType") .setDType("renderer") - .setHWidth("width-30 bold") + .setDAlign("text-center") + .setHWidth("width-30-p bold") .setHSort(false) .setDRenderer("ISSUE_RELATION_TYPE")) $scope.vm.relTableConfigs.push($tableProvider.config() .setHName("issue.relationIssueTitle") .setDType("renderer") - .setHWidth("width-60 bold") + .setDAlign("text-center") + .setHWidth("width-60-p bold") .setHSort(false) .setDRenderer("ISSUE_RELATION_MOVE")) $scope.vm.relTableConfigs.push($tableProvider.config() .setHName("issue.relationIssueDelete") .setDType("renderer") - .setHWidth("width-10 bold") + .setDAlign("text-center") + .setHWidth("width-20-p bold") .setDRenderer("ISSUE_RELATION_DELETE") .setHSort(false) .setDAlign("text-center")) + + angular.forEach($scope.vm.relTableConfigs, function (Rel_issueTableConfig) { + // �몴�떆 ���긽�씤 而щ읆留� �솕硫댁뿉 洹몃젮以��떎. + if (Rel_issueTableConfig.display) { + // �뀒�씠釉붿쓽 而щ읆�쓣 留뚮뱾�뼱以��떎. + $scope.fn.setRelTableColumn(Rel_issueTableConfig); + } + }); } - // �뿰愿� �씪媛� 紐⑸줉 媛��졇�삤湲� - // function getRelationIssueList() { - // var contents = { - // issueId : $rootScope.currentDetailIssueId, - // }; - // - // IssueRelation.find($resourceProvider.getContent( - // contents, - // $resourceProvider.getPageContent(0, 10))).then(function (result) { - // - // if (result.data.message.status === "success") { - // $scope.vm.relResponseData = result.data; - // } - // else { - // SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueRelation"), result.data.message.message); // "�뿰愿��씪媛� �깮�꽦 �떎�뙣" - // } - // }); - // } + // �븯�쐞 �씠�뒋 �뀒�씠釉� �꽕�젙 + function makeDownTableConfigs() { + $scope.vm.downTableConfigs = []; + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("issue.downIssueTitle") + .setDType("renderer") + .setDAlign("text-center") + .setHWidth("width-60-p bold") + .setHSort(false) + .setDRenderer("ISSUE_DOWN_MOVE")) + if($scope.vm.viewer.modifyPermissionCheck){ + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueDelete") + .setDType("renderer") + .setDAlign("text-center") + .setHWidth("width-20-p bold") + .setDRenderer("ISSUE_DOWN_DELETE") + .setHSort(false) + .setDAlign("text-center")) + } + + angular.forEach($scope.vm.downTableConfigs, function (Down_issueTableConfig) { + // �몴�떆 ���긽�씤 而щ읆留� �솕硫댁뿉 洹몃젮以��떎. + if (Down_issueTableConfig.display) { + // �뀒�씠釉붿쓽 而щ읆�쓣 留뚮뱾�뼱以��떎. + $scope.fn.setDownTableColumn(Down_issueTableConfig); + } + }); + } + + // �뿰愿� �씠�뒋 �뀒�씠釉� �꽕�젙 + function setRelTableConfigs(issueTableConfigVo) { + if (issueTableConfigVo == null) { + makeRelTableConfigs(); + return; + } + var issueTableConfigs = issueTableConfigVo.issueTableConfigs; + + // �뿰愿� �뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 媛믪쓣 媛��졇���꽌 �쟻�슜�븳�떎. + if ($rootScope.isDefined(issueTableConfigs)) { + // �씠�뒋 �뀒�씠釉� �꽕�젙 �젙蹂대�� ���옣 �븳�떎. + + $scope.vm.issueRelTableConfigs = []; + $scope.vm.issueRelTableConfigs = JSON.parse(issueTableConfigs); + $scope.vm.issueRelTableConfigs.sort(function (a, b) { + return a.position < b.position ? -1 : a.position > b.position ? 1 : 0; + }); + + $scope.vm.relTableConfigs = []; + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueType") + .setDType("renderer") + .setDAlign("text-center") + .setHWidth("width-30-p bold") + .setHSort(false) + .setDRenderer("ISSUE_RELATION_TYPE")) + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueTitle") + .setDType("renderer") + .setDAlign("text-center") + .setHWidth("width-60-p bold") + .setHSort(false) + .setDRenderer("ISSUE_RELATION_MOVE")) + angular.forEach($scope.vm.issueRelTableConfigs, function (Rel_issueTableConfig) { + // �몴�떆 ���긽�씤 而щ읆留� �솕硫댁뿉 洹몃젮以��떎. + if (Rel_issueTableConfig.display) { + // �뀒�씠釉붿쓽 而щ읆�쓣 留뚮뱾�뼱以��떎. + $scope.fn.setRelTableColumn(Rel_issueTableConfig); + + } + }); + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueDelete") + .setDType("renderer") + .setHWidth("width-20-p bold") + .setDRenderer("ISSUE_RELATION_DELETE") + .setHSort(false) + .setDAlign("text-center")) + + } else { + makeRelTableConfigs(); + } + + } + + // �븯�쐞 �씠�뒋 �긽�꽭 議고쉶 寃곌낵 �꽕�젙 + function setDownTableConfigs(issueTableConfigVo) { + if (issueTableConfigVo == null) return; + var issueTableConfigs = issueTableConfigVo.issueTableConfigs; + + // �뿰愿� �뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 媛믪쓣 媛��졇���꽌 �쟻�슜�븳�떎. + if ($rootScope.isDefined(issueTableConfigs)) { + // �씠�뒋 �뀒�씠釉� �꽕�젙 �젙蹂대�� ���옣 �븳�떎. + $scope.vm.issueDownTableConfigs = []; + $scope.vm.issueDownTableConfigs = JSON.parse(issueTableConfigs); + $scope.vm.issueDownTableConfigs.sort(function (a, b) { + return a.position < b.position ? -1 : a.position > b.position ? 1 : 0; + }); + $scope.vm.downTableConfigs = []; + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("issue.downIssueTitle") + .setDType("renderer") + .setDAlign("text-center") + .setHWidth("width-60-p bold") + .setHSort(false) + .setDRenderer("ISSUE_DOWN_MOVE")) + angular.forEach($scope.vm.issueDownTableConfigs, function (Down_issueTableConfig) { + // �몴�떆 ���긽�씤 而щ읆留� �솕硫댁뿉 洹몃젮以��떎. + if (Down_issueTableConfig.display) { + // �뀒�씠釉붿쓽 而щ읆�쓣 留뚮뱾�뼱以��떎. + $scope.fn.setDownTableColumn(Down_issueTableConfig); + } + }); + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("issue.relationIssueDelete") + .setDType("renderer") + .setHWidth("width-20-p bold") + .setDRenderer("ISSUE_DOWN_DELETE") + .setHSort(false) + .setDAlign("text-center")) + + } else { + makeDownTableConfigs(); + } + } + + // �뿰愿� �씠�뒋 異붽� + function addRelationIssue() { + if ($scope.vm.issueName.length == 0 || $scope.vm.form.issues.length == 0 + || $scope.vm.issueName != $scope.vm.form.issues[0].title) { + SweetAlert.error($filter("translate")("issue.errorSelectRelationIssue"), ""); + return; + } + + var contents = { + relationIssueType : $scope.vm.relationIssueType.id, + issueId : $rootScope.currentDetailIssueId, + relationIssueId : $scope.vm.form.issues[0].id, + priorityName : $scope.vm.priorityName + }; + + IssueRelation.add($resourceProvider.getContent( + contents, + $resourceProvider.getPageContent(0, 10))).then(function (result) { + + if (result.data.message.status === "success") { + $scope.fn.getIssueDetail(); + } + else { + SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueRelation"), result.data.message.message); // "�뿰愿��씪媛� �깮�꽦 �떎�뙣" + } + }); + } // �븯�쐞 �씠�뒋 異붽� function addDownIssue() { @@ -265,6 +630,7 @@ } var contents = { + issueId : $rootScope.currentDetailIssueId, id : $scope.vm.form.issuesDown[0].id, parentIssueId : $rootScope.currentDetailIssueId }; @@ -282,49 +648,45 @@ }); } - - // �뿰愿� �씠�뒋 異붽� - function addRelationIssue() { - if ($scope.vm.issueName.length == 0 || $scope.vm.form.issues.length == 0 - || $scope.vm.issueName != $scope.vm.form.issues[0].title) { - SweetAlert.error($filter("translate")("issue.errorSelectRelationIssue"), ""); - return; - } - - var contents = { - relationIssueType : $scope.vm.relationIssueType.id, - issueId : $rootScope.currentDetailIssueId, - relationIssueId : $scope.vm.form.issues[0].id - }; - - IssueRelation.add($resourceProvider.getContent( - contents, - $resourceProvider.getPageContent(0, 10))).then(function (result) { - - if (result.data.message.status === "success") { - $scope.fn.getIssueDetail(); - } - else { - SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueRelation"), result.data.message.message); // "�뿰愿��씪媛� �깮�꽦 �떎�뙣" - } - }); - } - + // �씠�뒋紐낆쓣 �겢由��븯硫� �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎. + // $rootScope.$on("getIssueDetail", function (event, args) { + // $scope.vm.viewer.id = args["id"]; + // $scope.fn.getIssueDetail(); + // }); // �씠�뒋紐낆쓣 �겢由��븯硫� �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎. + // $scope.$on("getIssueDetail", function (event, args) { + // $scope.vm.viewer.id = args["id"]; + // $scope.fn.getIssueDetail(); + // }); + + // �씠硫붿씪 蹂대궦�썑 �긽�꽭�솕硫� 媛깆떊 + // $rootScope.$on("getIssueDetail", function (event, args) { + // $scope.fn.getIssueDetail(); + // }); + $scope.$on("getIssueDetail", function (event, args) { - $scope.vm.viewer.id = args["id"]; $scope.fn.getIssueDetail(); }); + + $scope.$watch(function() { + return $rootScope.currentDetailIssueId; + }, function() { + if ($rootScope.currentDetailIssueId != null) { + $scope.vm.viewer.id = $rootScope.currentDetailIssueId; + $scope.fn.getIssueDetail(); + } + }, true); // 珥덇린�솕 �빐�빞�븷 �븷紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. function initReload() { $scope.vm.editor.issueStatus = false; $scope.vm.issueForm.issueStatusList = []; $scope.vm.issueForm.issueStatusId = ""; - if ($scope.$root.$$phase !== '$apply' && $scope.$root.$$phase !== '$digest') { - $scope.$apply(); - } + $scope.vm.issueTypeId = $rootScope.getCurrentIssueTypeId(); + // if ($scope.$root.$$phase !== '$apply' && $scope.$root.$$phase !== '$digest') { + // $scope.$apply(); + // } } // �씠�뒋 �긽�깭 蹂�寃� @@ -337,7 +699,27 @@ resolve : { parameter : function () { return { - issueIds : [$scope.vm.viewer.id] + issueIds : [$scope.vm.viewer.id], + projectId : $scope.vm.viewer.projectVo.id + }; + } + } + }); + } + + function modifyDownIssueStatus() { + $uibModal.open({ + templateUrl : 'views/issue/downIssueModifyStatus.html', + size : "md", + controller : 'downIssueModifyStatusController', + backdrop : 'static', + resolve : { + parameter : function () { + return { + issueTypeId : $scope.vm.viewer.issueTypeVo.id, + issueIds : [$scope.vm.viewer.id], + downIssues : $scope.vm.viewer.issueDownVos, + projectId : $scope.vm.viewer.projectVo.id }; } } @@ -374,11 +756,49 @@ resolve : { parameter : function () { return { - departmentVos : [$scope.vm.form.issues[0].departmentVos], - id : [$scope.vm.form.issues[0].id], - projectId : [$scope.vm.form.issues[0].projectVo.id], - project : [$scope.vm.form.issues[0].projectVo] + departmentVos : $scope.vm.form.issues[0].departmentVos, + id : $scope.vm.form.issues[0].id, + projectId : $scope.vm.form.issues[0].projectVo.id, + project : $scope.vm.form.issues[0].projectVo, + issueTypeId : $scope.vm.form.issues[0].issueTypeVo.id }; + } + } + }); + } + + // �뿰愿� �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 + function addRelationIssueTableConfig() { + $uibModal.open({ + templateUrl : 'views/issue/issueAddRelationTableConfig.html', + size : "lg", + controller : 'issueAddRelationTableConfigController', + backdrop : 'static', + resolve : { + parameter : function () { + return { + issueTypeId : $scope.vm.viewer.issueTypeVo.id + + }; + } + } + }); + } + + + // �븯�쐞 �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 + function addDownIssueTableConfig() { + $uibModal.open({ + templateUrl : 'views/issue/issueAddDownTableConfig.html', + size : "lg", + controller : 'issueAddDownTableConfigController', + backdrop : 'static', + resolve : { + parameter : function () { + return { + issueTypeId : $scope.vm.viewer.issueTypeVo.id + }; + } } }); @@ -412,17 +832,36 @@ }); } + // �뾽泥�/ISP/�샇�뒪�똿 �씠由꾩씠 �룷�븿 �뿬遺� �솗�씤 + function containsPartner(name) { + var result = false; + + if ($scope.vm.viewer.usePartnerVos != null) { + $scope.vm.viewer.usePartnerVos.forEach(function (partnerVo) { + if (name === partnerVo.name) { + result = true; + } + }); + } + return result; + + } + // �씠�뒋 �긽�꽭 �젙蹂� 議고쉶 function getIssueDetail() { // 珥덇린�솕 �빐�빞�븷 �븷紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. $scope.fn.initReload(); - Issue.detail($resourceProvider.getContent( + // $scope.fn.getRelTableConfigs(); + // $scope.fn.getDownTableConfigs(); + + Issue.detail($resourceProvider.getContent( {id : $scope.vm.viewer.id, deep : "02"}, $resourceProvider.getPageContent(0, 1))).then(function (result) { if (result.data.message.status === "success") { if (angular.isDefined(result.data.data)) { + $scope.vm.viewer = angular.copy(result.data.data); // �씠�뒋 �씠誘몄� 誘몃━ 蹂닿린 留뚮뱾湲� $scope.fn.makePreviewImages(result.data.data.attachedFileVos); @@ -437,7 +876,6 @@ // �씠�뒋�뿉�꽌 �궗�슜�옄媛� �꽑�깮�븳 �궗�슜�옄 �젙�쓽 �븘�뱶 媛믪쓣 �엯�젰 �뤌�뿉 �뀑�똿�븳�떎. $scope.fn.setUseValueByIssueTypeCustomFields(result.data.data.issueCustomFieldValueVos); - // �뿰愿� �씪媛� $scope.vm.issueName = ""; $scope.vm.form.issues = []; @@ -445,19 +883,32 @@ $scope.vm.form.issuesDown = []; $scope.vm.form.issuesDown.push(result.data.data); - makeTableConfigs(); - angular.forEach(result.data.data.issueRelationVos, function (issueRelationVo){ - issueRelationVo.relationIssueTypeName = $scope.vm.relationIssueTypes[issueRelationVo.relationIssueType].name; - $scope.vm.form.issues.push(issueRelationVo.issueRelation); - }); + var issueTableConfigVos = result.data.data.issueTableConfigVos; + $scope.fn.setRelTableConfigs(issueTableConfigVos[0]); + $scope.fn.setDownTableConfigs(issueTableConfigVos[1]); - makeTableConfigsDown(); - angular.forEach(result.data.data.issueDownVos, function (issueDownVo){ - $scope.vm.form.issuesDown.push(issueDownVo.issue); - }); + // �뿰愿� �씠�뒋 諛섎났臾� + if (result.data.data.issueRelationVos !== null) { + angular.forEach(result.data.data.issueRelationVos, function (issueRelationVo){ + issueRelationVo.relationIssueTypeName = $scope.vm.relationIssueTypes[issueRelationVo.relationIssueType].name; + $scope.vm.form.issues.push(issueRelationVo.issueRelation); + }); + } + // �븯�쐞 �씠�뒋 諛섎ぉ臾� + if (result.data.data.issueDownVos !== null){ + angular.forEach(result.data.data.issueDownVos, function (issueDownVo){ + //$scope.vm.form.issuesDown.push(issueDownVo.issueDown); + $scope.vm.form.issuesDown.push(issueDownVo); + + }); + } $scope.vm.viewer.issueRelationVos = result.data.data.issueRelationVos; $scope.vm.viewer.issueDownVos = result.data.data.issueDownVos; + + if ($rootScope.workProject.id > -1 && result.data.data.projectVo !== null) { + $rootScope.changeLastProject(result.data.data.projectVo.id); + } } } else { @@ -492,6 +943,12 @@ switch (issueTypeCustomField.customFieldVo.customFieldType) { case "INPUT" : case "SINGLE_SELECT" : + case "NUMBER" : + case "DATETIME" : + case "IP_ADDRESS" : + case "EMAIL" : + case "SITE" : + case "TEL" : issueTypeCustomField.useValues = ""; break; @@ -526,7 +983,7 @@ } }); } - +`` function updateActiveHistory() { $scope.vm.activeTab = 'ALL'; $scope.fn.makeActiveHistory(); @@ -642,22 +1099,59 @@ }); } + function sendMailVo(partnerVos) { + $scope.fn.sendMail($scope.fn.getParametersAll(), $scope.fn.getParameters(null, partnerVos)); + } + + function sendMailAll() { + var param = $scope.fn.getParametersAll(); + $scope.fn.sendMail(param, param); + } + // �듅�젙 �궗�슜�옄�뿉寃� �씠�뒋瑜� 硫붿씪濡� 諛쒖넚 - function sendMail(issueId, projectId) { + function sendMail(partnersAll, partners) { $uibModal.open({ - templateUrl : 'views/issue/issueSendMail.html', + templateUrl : 'views/issue/issueSendMailPartners.html', size : "md", - controller : 'issueSendMailController', + controller : 'issueSendMailPartnersController', backdrop : 'static', resolve : { - parameter : function () { - return { - issueId : issueId, - projectId : projectId - }; + parameter : { + partnersAll : partnersAll, + partners : partners, + issueId : $scope.vm.viewer.id, + projectId : $scope.vm.viewer.projectVo.id, } } }); + } + + function getParametersAll() { + var params = $scope.fn.getParameters(null, $scope.vm.viewer.issueCompanyVos); + params = $scope.fn.getParameters(params, $scope.vm.viewer.issueIspVos); + params = $scope.fn.getParameters(params, $scope.vm.viewer.issueHostingVos); + + if (params != null && params.length > 0) { + for (let i = 0; i < params.length; i++) { + params[i].id = i; + } + } + return params; + } + + function getParameters(sourceArr, partnerVos) { + var excludeVos = sourceArr != null ? sourceArr.slice() : []; + + angular.forEach(partnerVos, function (vo) { + var account = { + account : vo.email + } + Object.assign(vo, account) + + excludeVos.push(vo); + }); + + return excludeVos; } // 蹂�寃� �젙蹂대�� �솗�씤�븳�떎. @@ -693,7 +1187,6 @@ } }); } - } ]); } -- Gitblit v1.8.0