From 71b8c61b79be17f9ac886b947051d3256a32f159 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 금, 18 2월 2022 11:14:16 +0900
Subject: [PATCH] 이슈유형 설정에 상위 이슈 업체/ISP/호스팅 상속 기능 추가

---
 src/main/webapp/scripts/app/issue/issueAddDown.controller.js |   86 ++++++++++++++++++++++++++++--------------
 1 files changed, 57 insertions(+), 29 deletions(-)

diff --git a/src/main/webapp/scripts/app/issue/issueAddDown.controller.js b/src/main/webapp/scripts/app/issue/issueAddDown.controller.js
index bb6b2bc..3e1c6d0 100644
--- a/src/main/webapp/scripts/app/issue/issueAddDown.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueAddDown.controller.js
@@ -420,7 +420,16 @@
                 }
 
                 // �뾽泥� 移댄뀒怨좊━ autocomplete page �뾽�뜲�씠�듃
-                function getParentSectorListCallBack(result) {
+                function getParentSectorListCallBack(result, value) {
+                    if (value === "") {
+                        $scope.vm.form.parentSectorId = "";
+                        if ($rootScope.isDefined($scope.vm.form.parentSectors) && $rootScope.isDefined($scope.vm.form.parentSectors[0])) {
+                            $scope.vm.form.parentSectors[0].id = "";
+                        }
+                        $scope.vm.form.childSectorId = "";
+                        $scope.vm.form.childSector = "";
+                        $scope.vm.form.childSectors = [];
+                    }
                     $scope.vm.autoCompletePage.parentSector.totalPage = result.data.page.totalPage;
                 }
 
@@ -852,39 +861,53 @@
                     });
                 }
 
-                // �뿰愿� �씠�뒋 異붽�
+                // �븯�쐞 �씠�뒋 異붽�
                 function addDownIssue(downId) {
-                    /*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 ids = [];
-                    if (downId != null) {
-                        ids.push(downId);
-                    }
+                    let inheritYn = false;
 
-                    var contents = {
-                        //relationIssueType : $scope.vm.form.relationIssueTypeId,
-                        // issueId : $rootScope.currentDetailIssueId,
-                        issueId :  parameter.id,
-                        ids : ids,
-                        parentIssueId : parameter.id
-                    };
-
-                    Issue.modifyParentIssue($resourceProvider.getContent(
-                        contents,
-                        $resourceProvider.getPageContent(0, 10))).then(function (result) {
-
-                        if (result.data.message.status === "success") {
-                            //  �씠�뒋 �긽�꽭 �솕硫� �슂泥�
-                            $rootScope.$broadcast("getIssueDetail", {
-                                id : parameter.id
-                            });
+                    SweetAlert.swal({
+                        title : $filter("translate")("issue.addDownIssue"), // �븯�쐞 �씠�뒋 異붽�
+                        text : $filter("translate")("issue.wantToInheritPartnersOfParentIssue"), // �긽�쐞�씠�뒋�쓽 �뙆�듃�꼫 �젙蹂�(�뾽泥�/ISP/�샇�뒪�똿)瑜� �쟻�슜�떆�궎寃좎뒿�땲源�?
+                        type : "warning",
+                        showCancelButton : true,
+                        confirmButtonColor : "#DD6B55",
+                        confirmButtonText : $filter("translate")("common.ok"), // �꽕
+                        cancelButtonText : $filter("translate")("common.no"), // �븘�땲�삤
+                        closeOnConfirm : false,
+                        closeOnCancel : false
+                    },
+                    function (isConfirm) {
+                        if (isConfirm) {
+                            inheritYn = true;
                         }
-                        else {
-                            SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueDown"), result.data.message.message); // "�뿰愿��씪媛� �깮�꽦 �떎�뙣"
+
+                        if (downId != null) {
+                            ids.push(downId);
                         }
+
+                        var contents = {
+                            issueId :  parameter.id,
+                            ids : ids,
+                            parentIssueId : parameter.id,
+                            inheritYn : inheritYn
+                        };
+
+                        Issue.modifyParentIssue($resourceProvider.getContent(
+                            contents,
+                            $resourceProvider.getPageContent(0, 10))).then(function (result) {
+
+                            if (result.data.message.status === "success") {
+                                SweetAlert.close();
+                                //  �씠�뒋 �긽�꽭 �솕硫� �슂泥�
+                                $rootScope.$broadcast("getIssueDetail", {
+                                    id : parameter.id
+                                });
+                            }
+                            else {
+                                SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueDown"), result.data.message.message); // "�븯�쐞�씠�뒋 �깮�꽦 �떎�뙣"
+                            }
+                        });
                     });
                 }
 
@@ -1108,6 +1131,9 @@
                             $scope.vm.projectName = $rootScope.workProject.name;
                             $scope.vm.form.projects = [];
                             $scope.vm.form.projects.push($rootScope.workProject);
+                        } else {
+                            $scope.vm.projectName = parameter.project.name;
+                            $scope.vm.form.projects.push(parameter.project);
                         }
                         // �쁽�옱 �씠�뒋���엯 �쑀�삎 �꽕�젙
                         var id = $rootScope.getCurrentIssueTypeId();
@@ -1116,6 +1142,8 @@
                         } else {
                             $scope.vm.form.issueTypeId = parameter.issueTypeId.toString();
                         }
+                        // �씠�뒋�쑀�삎, �봽濡쒖젥�듃 set �븳 �썑�뿉 �궗�슜�옄�젙�쓽�븘�뱶 set
+                        $scope.fn.getIssueTypeCustomFields();
                         $log.debug("promises 寃곌낵 ", results);
                     });
                 }

--
Gitblit v1.8.0