From 94bc0a6bad49e818e54a5438a6f202448de05ee0 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 수, 26 1월 2022 15:51:16 +0900
Subject: [PATCH] - 이슈 수정 시 대분류만 선택하고 수정 시 오류 해결 - 전체 댓글 + 메일 보기 / 하위 이슈 댓글 + 메일 보기

---
 src/main/webapp/scripts/app/issue/issueAddRelation.controller.js                   |   12 +-
 src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js          |   12 +-
 src/main/webapp/custom_components/js-autocomplete-single/js-autocomplete-single.js |    2 
 src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js             |   12 +-
 src/main/webapp/i18n/ko/global.json                                                |    2 
 src/main/webapp/scripts/app/issue/issueAddDown.controller.js                       |   12 +-
 src/main/webapp/views/issue/issueDetail.html                                       |  114 +++++++++++++++++-----
 src/main/webapp/scripts/app/issue/issueDetail.controller.js                        |   92 +++++++++++++----
 src/main/webapp/scripts/app/issue/issueSendMailPartners.controller.js              |    4 
 src/main/webapp/scripts/app/issue/issueAdd.controller.js                           |   12 +-
 src/main/webapp/scripts/app/issue/issueModify.controller.js                        |   12 +-
 11 files changed, 199 insertions(+), 87 deletions(-)

diff --git a/src/main/webapp/custom_components/js-autocomplete-single/js-autocomplete-single.js b/src/main/webapp/custom_components/js-autocomplete-single/js-autocomplete-single.js
index 5d5fa69..322d125 100644
--- a/src/main/webapp/custom_components/js-autocomplete-single/js-autocomplete-single.js
+++ b/src/main/webapp/custom_components/js-autocomplete-single/js-autocomplete-single.js
@@ -227,7 +227,7 @@
                 function toggleDropdown() {
                     //  �븘�씠�뀥�씠 �꽑�깮�릺�뼱 �엳�쓣 寃쎌슦 紐⑸줉 �젅�씠�뼱�뒗 �몴�떆�맆 �닔 �뾾�떎.
                     $scope.open = true;
-                    if ($rootScope.isDefined($scope.selectedModel) && $scope.selectedModel.length > 0) {
+                    if ($rootScope.isDefined($scope.search)) {
                         $scope.open = false;
                         $scope.options = [];
                     }
diff --git a/src/main/webapp/i18n/ko/global.json b/src/main/webapp/i18n/ko/global.json
index 054a277..27b57df 100644
--- a/src/main/webapp/i18n/ko/global.json
+++ b/src/main/webapp/i18n/ko/global.json
@@ -770,6 +770,8 @@
         "countDownIssue": "�븯�쐞 �씠�뒋",
         "noDate": "湲곌컙 �뾾�쓬",
         "fullView": "�쟾泥대낫湲�",
+        "fullMailsAndComments": "�쟾泥대낫湲�(硫붿씪+�뙎湲�)",
+        "downMailsAndComments": "�븯�쐞�씠�뒋(硫붿씪+�뙎湲�)",
         "comments": "�뙎湲�",
         "mails": "硫붿씪",
         "record": "湲곕줉",
diff --git a/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js b/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js
index fdb2b91..aaae690 100644
--- a/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js
+++ b/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js
@@ -154,7 +154,7 @@
                     if ($rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
                     }
-
+                    $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
@@ -227,35 +227,35 @@
                         memo : $scope.vm.form.memo,  //鍮꾧퀬
                         companyTypeId : (function () {
                             var companyTypeId = -1;
-                            if ($scope.vm.form.companyTypes != null) {
+                            if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
                                 companyTypeId = $scope.vm.form.companyTypes[0].id;
                             }
                             return companyTypeId;
                         })(),
                         parentSectorId : (function () {
                             var parentSectorId = -1;
-                            if ($scope.vm.form.parentSectors != null) {
+                            if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) {
                                 parentSectorId = $scope.vm.form.parentSectors[0].id;
                             }
                             return parentSectorId;
                         })(),
                         childSectorId : (function () {
                             var childSectorId = -1;
-                            if ($scope.vm.form.childSectors != null) {
+                            if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) {
                                 childSectorId = $scope.vm.form.childSectors[0].id;
                             }
                             return childSectorId;
                         })(),
                         regionId : (function () {
                             var regionId = -1;
-                            if ($scope.vm.form.regions != null) {
+                            if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) {
                                 regionId = $scope.vm.form.regions[0].id;
                             }
                             return regionId;
                         })(),
                         statusId : (function () {
                             var statusId = -1;
-                            if ($scope.vm.form.statuses != null) {
+                            if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) {
                                 statusId = $scope.vm.form.statuses[0].id;
                             } else if ($scope.vm.form.status !== ""){
                                 statusId = 120; //吏곸젒�엯�젰 �씪 寃쎌슦
diff --git a/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js b/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js
index c7e5a77..90ab5c3 100644
--- a/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js
+++ b/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js
@@ -158,7 +158,7 @@
                     if ($rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
                     }
-
+                    $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
@@ -237,7 +237,7 @@
                         memo : $rootScope.preventXss($scope.vm.form.memo),
                         companyTypeId : (function () {
                             var companyTypeId = -1;
-                            if ($scope.vm.form.companyTypes != null) {
+                            if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
                                 companyTypeId = $scope.vm.form.companyTypes[0].id;
                             } else {
                                 companyTypeId = $scope.vm.form.companyTypeId;
@@ -246,7 +246,7 @@
                         })(),
                         parentSectorId : (function () {
                             var parentSectorId = -1;
-                            if ($scope.vm.form.parentSectors != null) {
+                            if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) {
                                 parentSectorId = $scope.vm.form.parentSectors[0].id;
                             } else {
                                 parentSectorId = $scope.vm.form.parentSectorId;
@@ -255,7 +255,7 @@
                         })(),
                         childSectorId : (function () {
                             var childSectorId = -1;
-                            if ($scope.vm.form.childSectors != null) {
+                            if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) {
                                 childSectorId = $scope.vm.form.childSectors[0].id;
                             } else {
                                 childSectorId = $scope.vm.form.childSectorId;
@@ -264,7 +264,7 @@
                         })(),
                         regionId : (function () {
                             var regionId = -1;
-                            if ($scope.vm.form.regions != null) {
+                            if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) {
                                 regionId = $scope.vm.form.regions[0].id;
                             } else {
                                 regionId = $scope.vm.form.regionId;
@@ -273,7 +273,7 @@
                         })(),
                         statusId : (function () {
                             var statusId = -1;
-                            if ($scope.vm.form.statuses != null) {
+                            if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) {
                                 statusId = $scope.vm.form.statuses[0].id;
                             } else {
                                 statusId = $scope.vm.form.statusId;
diff --git a/src/main/webapp/scripts/app/issue/issueAdd.controller.js b/src/main/webapp/scripts/app/issue/issueAdd.controller.js
index d1cfc5b..054abd1 100644
--- a/src/main/webapp/scripts/app/issue/issueAdd.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueAdd.controller.js
@@ -554,7 +554,7 @@
                     if ($rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
                     }
-
+                    $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
@@ -681,35 +681,35 @@
                         companyMemo : $scope.vm.companyMemo,
                         companyTypeId : (function () {
                             var companyTypeId = -1;
-                            if ($scope.vm.form.companyTypes != null) {
+                            if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
                                 companyTypeId = $scope.vm.form.companyTypes[0].id;
                             }
                             return companyTypeId;
                         })(),
                         parentSectorId : (function () {
                             var parentSectorId = -1;
-                            if ($scope.vm.form.parentSectors != null) {
+                            if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) {
                                 parentSectorId = $scope.vm.form.parentSectors[0].id;
                             }
                             return parentSectorId;
                         })(),
                         childSectorId : (function () {
                             var childSectorId = -1;
-                            if ($scope.vm.form.childSectors != null) {
+                            if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) {
                                 childSectorId = $scope.vm.form.childSectors[0].id;
                             }
                             return childSectorId;
                         })(),
                         regionId : (function () {
                             var regionId = -1;
-                            if ($scope.vm.form.regions != null) {
+                            if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) {
                                 regionId = $scope.vm.form.regions[0].id;
                             }
                             return regionId;
                         })(),
                         statusId : (function () {
                             var statusId = -1;
-                            if ($scope.vm.form.statuses != null) {
+                            if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) {
                                 statusId = $scope.vm.form.statuses[0].id;
                             } else if ($scope.vm.form.status !== ""){
                                 statusId = 120; //吏곸젒�엯�젰 �씪 寃쎌슦
diff --git a/src/main/webapp/scripts/app/issue/issueAddDown.controller.js b/src/main/webapp/scripts/app/issue/issueAddDown.controller.js
index c10f9ba..c0ac2c3 100644
--- a/src/main/webapp/scripts/app/issue/issueAddDown.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueAddDown.controller.js
@@ -542,7 +542,7 @@
                     if ($rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
                     }
-
+                    $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
@@ -572,35 +572,35 @@
                         companyMemo : $scope.vm.companyMemo,
                         companyTypeId : (function () {
                             var companyTypeId = -1;
-                            if ($scope.vm.form.companyTypes != null) {
+                            if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
                                 companyTypeId = $scope.vm.form.companyTypes[0].id;
                             }
                             return companyTypeId;
                         })(),
                         parentSectorId : (function () {
                             var parentSectorId = -1;
-                            if ($scope.vm.form.parentSectors != null) {
+                            if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) {
                                 parentSectorId = $scope.vm.form.parentSectors[0].id;
                             }
                             return parentSectorId;
                         })(),
                         childSectorId : (function () {
                             var childSectorId = -1;
-                            if ($scope.vm.form.childSectors != null) {
+                            if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) {
                                 childSectorId = $scope.vm.form.childSectors[0].id;
                             }
                             return childSectorId;
                         })(),
                         regionId : (function () {
                             var regionId = -1;
-                            if ($scope.vm.form.regions != null) {
+                            if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) {
                                 regionId = $scope.vm.form.regions[0].id;
                             }
                             return regionId;
                         })(),
                         statusId : (function () {
                             var statusId = -1;
-                            if ($scope.vm.form.statuses != null) {
+                            if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) {
                                 statusId = $scope.vm.form.statuses[0].id;
                             } else if ($scope.vm.form.status !== ""){
                                 statusId = 120; //吏곸젒�엯�젰 �씪 寃쎌슦
diff --git a/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js b/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js
index ef407f5..feda0af 100644
--- a/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueAddRelation.controller.js
@@ -557,7 +557,7 @@
                     if ($rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
                     }
-
+                    $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
@@ -587,35 +587,35 @@
                         companyMemo : $scope.vm.companyMemo,
                         companyTypeId : (function () {
                             var companyTypeId = -1;
-                            if ($scope.vm.form.companyTypes != null) {
+                            if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
                                 companyTypeId = $scope.vm.form.companyTypes[0].id;
                             }
                             return companyTypeId;
                         })(),
                         parentSectorId : (function () {
                             var parentSectorId = -1;
-                            if ($scope.vm.form.parentSectors != null) {
+                            if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) {
                                 parentSectorId = $scope.vm.form.parentSectors[0].id;
                             }
                             return parentSectorId;
                         })(),
                         childSectorId : (function () {
                             var childSectorId = -1;
-                            if ($scope.vm.form.childSectors != null) {
+                            if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) {
                                 childSectorId = $scope.vm.form.childSectors[0].id;
                             }
                             return childSectorId;
                         })(),
                         regionId : (function () {
                             var regionId = -1;
-                            if ($scope.vm.form.regions != null) {
+                            if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) {
                                 regionId = $scope.vm.form.regions[0].id;
                             }
                             return regionId;
                         })(),
                         statusId : (function () {
                             var statusId = -1;
-                            if ($scope.vm.form.statuses != null) {
+                            if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) {
                                 statusId = $scope.vm.form.statuses[0].id;
                             } else if ($scope.vm.form.status !== ""){
                                 statusId = 120; //吏곸젒�엯�젰 �씪 寃쎌슦
diff --git a/src/main/webapp/scripts/app/issue/issueDetail.controller.js b/src/main/webapp/scripts/app/issue/issueDetail.controller.js
index 756ae3c..b63cd07 100644
--- a/src/main/webapp/scripts/app/issue/issueDetail.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueDetail.controller.js
@@ -50,6 +50,7 @@
                 $scope.fn.setDownTableConfigs = setDownTableConfigs;
                 $scope.fn.containsPartner = containsPartner;
                 $scope.fn.onActivate = onActivate;
+                $scope.fn.issueBack = issueBack;
                 $scope.fn.goParentIssue = goParentIssue;
                 $scope.fn.removeRelationIssue = removeRelationIssue;
                 $scope.fn.removeDownIssue = removeDownIssue;
@@ -146,10 +147,22 @@
                     $scope.fn.onActivate();
                 }
 
+                // �뮘濡쒓�湲� 踰꾪듉
+                function issueBack() {
+                    var index = $scope.$parent.vm.issueIds.length -2;
+                    if (index > -1) {
+                        var preIssueId = $scope.$parent.vm.issueIds[index];
+                        $scope.$parent.vm.issueIds.splice(index + 1, 1);
+                        $scope.$parent.tableEvent.changeDetailView(preIssueId, true);
+                    }
+                }
+
                 // �긽�쐞 �씠�뒋 �겢由��떆 �긽�쐞 �씠�뒋濡� �씠�룞
                 function goParentIssue() {
                     var parentIssueId = $scope.vm.parentIssueId;
                     $scope.$parent.tableEvent.changeDetailView(parentIssueId, true);
+                    //�븯�쐞�씠�뒋-> �긽�쐞�씠�뒋 -> �뿰愿��씠�뒋�뿉�꽌 �뮘濡쒓�湲� 踰꾪듉 �겢由� �떆 �븯�쐞�씠�뒋濡� �씠�룞�릺�뒗 臾몄젣濡� 留덉�留� 諛곗뿴媛� �젣嫄�
+                    $scope.$parent.vm.issueIds.pop();
                 }
 
                 //  �럹�씠吏� 蹂�寃�
@@ -1246,25 +1259,38 @@
 
                 //  �솢�룞 �씠�젰 留뚮뱾湲�
                 function makeActiveHistory() {
-                    $scope.vm.viewer.activeParentHistory = "";
-                    $scope.vm.viewer.activeHistory = "";
-                    $scope.vm.viewer.activeParentMailHistory = "";
+                    $scope.vm.viewer.activeParentHistory = [];
+                    $scope.vm.viewer.activeHistory = [];
+                    $scope.vm.viewer.activeParentMailHistory = [];
+                    $scope.vm.viewer.activeAllMailAndReplyHistory = []; //�긽�쐞+�븯�쐞 硫붿씪,�뙎湲� �엳�뒪�넗由�
                     var oriMailHistory = [];
+                    var oriCommentHistory = [];
 
                     if ($scope.vm.viewer.issueHistoryVos != null && $scope.vm.viewer.issueHistoryVos.length > 0) {
+                        //  �긽�쐞�씠�뒋 硫붿씪 �엳�뒪�넗由�
                         for (var i=0; i<$scope.vm.viewer.issueHistoryVos.length; i++) {
                             if ($scope.vm.viewer.issueHistoryVos[i].issueHistoryType === "SEND") {
                                 oriMailHistory.push($scope.vm.viewer.issueHistoryVos[i]);
                             }
                         }
-                        $scope.vm.viewer.activeParentMailHistory = angular.copy(oriMailHistory);
+                        //$scope.vm.viewer.activeParentMailHistory = angular.copy(oriMailHistory);
+                    }
+                    
+                    //  �긽�쐞�씠�뒋 �뙎湲� �엳�뒪�넗由�
+                    if ($scope.vm.viewer.issueCommentVos != null && $scope.vm.viewer.issueCommentVos.length > 0) {
+                        for (var i=0; i<$scope.vm.viewer.issueCommentVos.length; i++) {
+                            oriCommentHistory.push($scope.vm.viewer.issueCommentVos[i]);
+                        }
                     }
 
+                    $scope.vm.viewer.activeAllMailAndReplyHistory = oriMailHistory.concat(oriCommentHistory);
+                    
+                    //  �븯�쐞�씠�뒋 �엳�뒪�넗由�
                     if ($scope.vm.viewer.issueDownVos != null && $scope.vm.viewer.issueDownVos.length > 0) {
-                        $scope.vm.viewer.activeDownHistory = ""; //�븯�쐞�씠�뒋 �엳�뒪�넗由щ쭔
-                        $scope.vm.viewer.downComment = ""; //�븯�쐞�씠�뒋 �뙎湲�留�
-                        $scope.vm.viewer.activeDownMailHistory = ""; //�븯�쐞�씠�뒋 硫붿씪留�
-                        $scope.vm.viewer.activeDownAllHistory = ""; //�븯�쐞�씠�뒋 �엳�뒪�넗由�+�뙎湲�
+                        $scope.vm.viewer.activeDownHistory = []; //�븯�쐞�씠�뒋 �엳�뒪�넗由щ쭔
+                        $scope.vm.viewer.downComment = []; //�븯�쐞�씠�뒋 �뙎湲�留�
+                        $scope.vm.viewer.activeDownAllHistory = []; //�븯�쐞�씠�뒋 �엳�뒪�넗由�+�뙎湲�
+                        $scope.vm.viewer.activeDownMailAndReplyHistory = []; //�븯�쐞 硫붿씪+�뙎湲� �엳�뒪�넗由�
                         var downTitle = "";
                         var oriDownHistory = [];
                         var oriDownCommentHistory = [];
@@ -1273,7 +1299,6 @@
                         // �븯�쐞�씠�뒋 �엳�뒪�넗由�
                         for (var i=0; i<$scope.vm.viewer.issueDownVos.length; i++){
                             oriDownHistory.push($scope.vm.viewer.issueDownVos[i].issueHistoryVos);
-                            oriDownCommentHistory.push($scope.vm.viewer.issueDownVos[i].issueCommentVos);
 
                             //  �븯�쐞�씠�뒋 硫붿씪 湲곕줉
                             for (var j=0; j<$scope.vm.viewer.issueDownVos[i].issueHistoryVos.length; j++) {
@@ -1281,13 +1306,22 @@
                                     oriDownMailHistory.push($scope.vm.viewer.issueDownVos[i].issueHistoryVos[j]);
                                 }
                             }
+                            //  �븯�쐞�씠�뒋 �뙎湲� 湲곕줉
+                            for (var k=0; k<$scope.vm.viewer.issueDownVos[i].issueCommentVos.length; k++) {
+                                oriDownCommentHistory.push($scope.vm.viewer.issueDownVos[i].issueCommentVos[k]);
+                            }
                         }
-                        //  �븯�쐞�씠�뒋 硫붿씪留� ���옣
-                        $scope.vm.viewer.activeDownMailHistory = angular.copy(oriDownMailHistory);
-                        $scope.vm.viewer.activeDownMailHistory.sort(function (a, b) {   //�궡由쇱감�닚
+                        //  �븯�쐞�씠�뒋 硫붿씪+�뙎湲� ���옣
+                        $scope.vm.viewer.activeDownMailAndReplyHistory = oriDownCommentHistory.concat(oriDownMailHistory);
+                        for (var i=0; i<$scope.vm.viewer.activeDownMailAndReplyHistory.length; i++){
+                            downTitle = "<div class='dot' style='margin-bottom: -8px'>*�븯�쐞�씠�뒋 : "+$scope.vm.viewer.activeDownMailAndReplyHistory[i].title+"</div>";
+                            $scope.vm.viewer.activeDownMailAndReplyHistory[i].desc = downTitle + $scope.vm.viewer.activeDownMailAndReplyHistory[i].description;
+                        }
+
+                        $scope.vm.viewer.activeDownMailAndReplyHistory.sort(function (a, b) {   //"MAIL_AND_REPLY_DOWN" �궡由쇱감�닚
                             return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
                         });
-                        
+
                         for (var i=0; i<oriDownHistory.length; i++){
                             if ($scope.vm.viewer.activeDownHistory === "") {
                                 $scope.vm.viewer.activeDownHistory = oriDownHistory[i];
@@ -1305,29 +1339,41 @@
                         });
 
                         // �븯�쐞�씠�뒋 �뙎湲� �엳�뒪�넗由�
-                       for (var i=0; i<oriDownCommentHistory.length; i++) {
+                        for (var i=0; i<oriDownCommentHistory.length; i++) {
                            if ($scope.vm.viewer.downComment === "") {
                                $scope.vm.viewer.downComment = oriDownCommentHistory[i];
                            } else {
                                $scope.vm.viewer.downComment = $scope.vm.viewer.downComment.concat(oriDownCommentHistory[i]);
                            }
-                       }
-                       $scope.vm.viewer.issueDownVos.sort(function (a, b) {   //�궡由쇱감�닚
-                           return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
-                       });
+                        }
+                        $scope.vm.viewer.issueDownVos.sort(function (a, b) {   //�궡由쇱감�닚
+                            return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
+                        });
 
-                       $scope.vm.viewer.activeDownAllHistory = $scope.vm.viewer.downComment.concat($scope.vm.viewer.activeDownHistory);
-                       $scope.vm.viewer.activeParentHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos);
-                       $scope.vm.viewer.activeHistory = $scope.vm.viewer.activeParentHistory.concat($scope.vm.viewer.activeDownAllHistory);
+                        $scope.vm.viewer.activeDownAllHistory = $scope.vm.viewer.downComment.concat($scope.vm.viewer.activeDownHistory);
+
+                        $scope.vm.viewer.activeDownAllHistory.sort(function (a, b) {   //"RECODE_DOWN" �궡由쇱감�닚
+                            return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
+                        });
+
+                        $scope.vm.viewer.activeParentHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos);
+                        $scope.vm.viewer.activeHistory = $scope.vm.viewer.activeParentHistory.concat($scope.vm.viewer.activeDownAllHistory);
+                        $scope.vm.viewer.activeAllMailAndReplyHistory = $scope.vm.viewer.activeAllMailAndReplyHistory.concat($scope.vm.viewer.activeDownMailAndReplyHistory);
 
                     }else {
                         $scope.vm.viewer.activeParentHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos);
                         $scope.vm.viewer.activeHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos);
                     }
-                    $scope.vm.viewer.activeParentHistory.sort(function (a, b) {   //�궡由쇱감�닚
+
+                    $scope.vm.viewer.activeHistory.sort(function (a, b) {   //"ALL" �궡由쇱감�닚
                         return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
                     });
-                    $scope.vm.viewer.activeHistory.sort(function (a, b) {   //�궡由쇱감�닚
+
+                    $scope.vm.viewer.activeParentHistory.sort(function (a, b) {   //"RECODE" �궡由쇱감�닚
+                        return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
+                    });
+
+                    $scope.vm.viewer.activeAllMailAndReplyHistory.sort(function (a, b) {   //"MAIL_AND_REPLY" �궡由쇱감�닚
                         return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
                     });
                 }
diff --git a/src/main/webapp/scripts/app/issue/issueModify.controller.js b/src/main/webapp/scripts/app/issue/issueModify.controller.js
index d5395d2..49428eb 100644
--- a/src/main/webapp/scripts/app/issue/issueModify.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueModify.controller.js
@@ -442,7 +442,7 @@
                     if ($rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
                     }
-
+                    $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
@@ -561,7 +561,7 @@
 
                         companyTypeId : (function () {
                             var companyTypeId = -1;
-                            if ($scope.vm.form.companyTypes != null) {
+                            if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
                                 companyTypeId = $scope.vm.form.companyTypes[0].id;
                             } else {
                                 companyTypeId = $scope.vm.form.companyTypeId;
@@ -570,7 +570,7 @@
                         })(),
                         parentSectorId : (function () {
                             var parentSectorId = -1;
-                            if ($scope.vm.form.parentSectors != null) {
+                            if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) {
                                 parentSectorId = $scope.vm.form.parentSectors[0].id;
                             } else {
                                 parentSectorId = $scope.vm.form.parentSectorId;
@@ -579,7 +579,7 @@
                         })(),
                         childSectorId : (function () {
                             var childSectorId = -1;
-                            if ($scope.vm.form.childSectors != null) {
+                            if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) {
                                 childSectorId = $scope.vm.form.childSectors[0].id;
                             } else {
                                 childSectorId = $scope.vm.form.childSectorId;
@@ -588,7 +588,7 @@
                         })(),
                         regionId : (function () {
                             var regionId = -1;
-                            if ($scope.vm.form.regions != null) {
+                            if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) {
                                 regionId = $scope.vm.form.regions[0].id;
                             } else {
                                 regionId = $scope.vm.form.regionId;
@@ -597,7 +597,7 @@
                         })(),
                         statusId : (function () {
                             var statusId = -1;
-                            if ($scope.vm.form.statuses != null) {
+                            if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) {
                                 statusId = $scope.vm.form.statuses[0].id;
                             } else {
                                 statusId = $scope.vm.form.statusId;
diff --git a/src/main/webapp/scripts/app/issue/issueSendMailPartners.controller.js b/src/main/webapp/scripts/app/issue/issueSendMailPartners.controller.js
index de4f059..f1b891f 100644
--- a/src/main/webapp/scripts/app/issue/issueSendMailPartners.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueSendMailPartners.controller.js
@@ -27,13 +27,13 @@
                     companyVos : parameter.companyVos,
                     ispVos : parameter.ispVos,
                     hostingVos : parameter.hostingVos,
-                    partners : parameter.partnersAll.slice(),
+                    partners : parameter.partnersAll,
                     html : "",
                     tab : "SEND_TEMPLATE",
                     form : {
                         id : parameter.issueId,  //  �씠�뒋 踰덊샇
                         projects : [{ id : parameter.projectId}],  //  �봽濡쒖젥�듃
-                        mailUsers : parameter.partners.slice(),   //  硫붿씪 �쟾�넚諛쏅뒗 �궗�슜�옄
+                        mailUsers : parameter.partners,   //  硫붿씪 �쟾�넚諛쏅뒗 �궗�슜�옄
                         account : [{account : [], name : [], id : []}],
                         files : [], //  �뾽濡쒕뱶 �뙆�씪
                         attachedFiles : [], //  �꽟癒몃끂�듃濡� �뙆�씪 �뾽濡쒕뱶瑜� �븷 寃쎌슦 �꽌踰꾩뿉�꽌 pk瑜� �뵲怨� issue id�� �뿰�룞 �옉�뾽�씠 �븘�슂�븯�떎.
diff --git a/src/main/webapp/views/issue/issueDetail.html b/src/main/webapp/views/issue/issueDetail.html
index a24b54f..c86c85d 100644
--- a/src/main/webapp/views/issue/issueDetail.html
+++ b/src/main/webapp/views/issue/issueDetail.html
@@ -110,7 +110,7 @@
                 <i class="os-icon os-icon-edit-1 mr-20" ng-click="fn.modify(vm.viewer.id)"
                    ng-if="vm.viewer.modifyPermissionCheck" data-toggle="tooltip" data-placement="left" title="�씠�뒋 �닔�젙 �븯湲�"></i>
                 <!-- �긽�쐞 �씠�뒋媛� �엳�쓣�븣 �뮘濡쒓�湲� 踰꾪듉 �깮�꽦 -->
-                <span ng-if="vm.issueIds.length != 0 && vm.issueIds.length != 1" class="issue-close mr-10" ng-click="fn.issueBack()"><i class="os-icon os-icon-arrow-left7" data-toggle="tooltip" data-placement="left" title="�씠�뒋 �뮘濡� �씠�룞"></i></span>
+                <span ng-if="vm.issueIds[0] != vm.viewer.id && vm.issueIds.length != 0 && vm.issueIds.length != 1" class="issue-close mr-10" ng-click="fn.issueBack()"><i class="os-icon os-icon-arrow-left7" data-toggle="tooltip" data-placement="left" title="�씠�뒋 �뮘濡� �씠�룞"></i></span>
                 <!-- �긽�쐞 �씠�뒋媛� �엳�쓣�븣 �긽�꽭�솕硫� �떕湲곕쾭�듉 �쐞移� 議곗젙 -->
                 <span class="issue-close" ng-click="fn.listView()"><i class="os-icon os-icon-close" data-toggle="tooltip" data-placement="left" title="�긽�꽭 �솕硫� �떕湲�"></i></span>
             </a>
@@ -828,28 +828,20 @@
                                                 translate="common.fullView">�쟾泥대낫湲�</span></a>
                                     </li>
                                     <li class="nav-item cursor">
+                                        <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'MAIL_AND_REPLY' }"
+                                           ng-click="vm.activeTab = 'MAIL_AND_REPLY'"><span translate="common.fullMailsAndComments">�쟾泥대낫湲�(硫붿씪+�뙎湲�)</span></a>
+                                    </li>
+                                    <li class="nav-item cursor">
                                         <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'RECODE' }"
                                            ng-click="vm.activeTab = 'RECODE'"><span translate="common.record">湲곕줉</span></a>
                                     </li>
                                     <li class="nav-item cursor">
-                                        <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'MAIL' }"
-                                           ng-click="vm.activeTab = 'MAIL'"><span translate="common.mails">硫붿씪</span></a>
-                                    </li>
-                                    <li class="nav-item cursor">
-                                        <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'REPLY' }"
-                                           ng-click="vm.activeTab = 'REPLY'"><span translate="common.comments">�뙎湲�</span></a>
+                                        <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'MAIL_AND_REPLY_DOWN' }"
+                                           ng-click="vm.activeTab = 'MAIL_AND_REPLY_DOWN'"><span translate="common.downMailsAndComments">�븯�쐞�씠�뒋(硫붿씪+�뙎湲�)</span></a>
                                     </li>
                                     <li class="nav-item cursor">
                                         <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'RECODE_DOWN' }"
                                            ng-click="vm.activeTab = 'RECODE_DOWN'"><span translate="common.recordDown">�븯�쐞�씠�뒋 湲곕줉</span></a>
-                                    </li>
-                                    <li class="nav-item cursor">
-                                        <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'MAIL_DOWN' }"
-                                           ng-click="vm.activeTab = 'MAIL_DOWN'"><span translate="common.downMails">�븯�쐞�씠�뒋 硫붿씪</span></a>
-                                    </li>
-                                    <li class="nav-item cursor">
-                                        <a class="nav-link" ng-class="{ 'active' : vm.activeTab == 'REPLY_DOWN' }"
-                                           ng-click="vm.activeTab = 'REPLY_DOWN'"><span translate="common.downComments">�븯�쐞�씠�뒋 �뙎湲�</span></a>
                                     </li>
                                 </ul>
                             </div>
@@ -992,15 +984,55 @@
                                     </div>
                                 </div>
 
-                                <!--    硫붿씪 蹂닿린    -->
-                                <div ng-if="vm.activeTab == 'MAIL'">
-                                    <div class="no-cont2" ng-if="vm.viewer.activeParentMailHistory.length < 1" translate="common.noRecord">
+                                <!--    �쟾泥�(�긽�쐞+�븯�쐞) 硫붿씪+�뙎湲� 蹂닿린    -->
+                                <div ng-if="vm.activeTab == 'MAIL_AND_REPLY'">
+                                    <div class="no-cont2" ng-if="vm.viewer.activeAllMailAndReplyHistory.length < 1" translate="common.noRecord">
                                         湲곕줉�씠 �뾾�뒿�땲�떎.
                                     </div>
 
-                                    <div class="ae-item" ng-repeat="issueHistory in vm.viewer.activeParentMailHistory">
+                                    <div class="ae-item row" ng-repeat="issueHistory in vm.viewer.activeAllMailAndReplyHistory">
+                                        <!-- 硫붿씪�씤 寃쎌슦 -->
                                         <div class="aei-content" ng-if="$root.isDefined(issueHistory.issueHistoryType)">
-                                            <div dom-append dom="issueHistory.description"></div>
+                                            <div ng-if="!$root.isDefined(issueHistory.desc)" dom-append dom="issueHistory.description"></div>
+                                            <div ng-if="$root.isDefined(issueHistory.desc)" dom-append dom="issueHistory.desc"></div>
+                                        </div>
+
+                                        <!--    �뙎湲��씤 寃쎌슦  -->
+                                        <div ng-if="!$root.isDefined(issueHistory.issueHistoryType)"
+                                             ng-show="vm.viewer.title !== issueHistory.title">
+                                            <span class="dot">
+                                                *�븯�쐞�씠�뒋 : {{::issueHistory.title}}
+                                            </span>
+                                        </div>
+                                        <div class="aei-image" style="position: absolute; top: 30%" ng-if="!$root.isDefined(issueHistory.issueHistoryType)">
+                                            <div class="user-avatar-w">
+                                                <img ng-show="vm.viewer.title !== issueHistory.title"
+                                                     style="margin-top: 15px" alt="image" ng-src="{{::issueHistory.profile}}">
+                                                <img ng-show="vm.viewer.title === issueHistory.title"
+                                                     alt="image" ng-src="{{::issueHistory.profile}}">
+                                            </div>
+                                        </div>
+
+                                        <div class="aei-content"
+                                             ng-if="!$root.isDefined(issueHistory.issueHistoryType)">
+                                            <h6 class="aei-title mt-1 ml-3per">
+                                                {{::issueHistory.registerName}}
+                                            </h6>
+                                            <div class="date-break mt-2 ml-3per">
+                                                <span>{{::issueHistory.registerDate}}</span>
+                                            </div>
+                                            <div class="aei-delete"
+                                                 ng-click="fn.removeComment(issueHistory)"
+                                                 ng-show="vm.viewer.modifyPermissionCheck || $root.user.id == issueHistory.registerId">
+                                                <i class="os-icon os-icon-close"></i>
+                                            </div>
+                                            <div class="chat-messages">
+                                                <div class="message" style="margin-left: 3.3%">
+                                                    <div class="message-content">
+                                                        <span class="issue-detail-word-break">{{::issueHistory.description}}</span>
+                                                    </div>
+                                                </div>
+                                            </div>
                                         </div>
                                     </div>
                                 </div>
@@ -1049,15 +1081,47 @@
                                     </div>
                                 </div>
 
-                                <!--    �븯�쐞�씠�뒋 硫붿씪 蹂닿린    -->
-                                <div ng-if="vm.activeTab == 'MAIL_DOWN'">
-                                    <div class="no-cont2" ng-if="vm.viewer.activeDownMailHistory.length < 1" translate="common.noRecord">
+                                <!--    �븯�쐞�씠�뒋 硫붿씪+�뙎湲� 蹂닿린    -->
+                                <div ng-if="vm.activeTab == 'MAIL_AND_REPLY_DOWN'">
+                                    <div class="no-cont2" ng-if="vm.viewer.activeDownMailAndReplyHistory.length < 1" translate="common.noRecord">
                                         湲곕줉�씠 �뾾�뒿�땲�떎.
                                     </div>
 
-                                    <div class="ae-item" ng-repeat="issueHistory in vm.viewer.activeDownMailHistory">
+                                    <div class="ae-item row" ng-repeat="issueHistory in vm.viewer.activeDownMailAndReplyHistory">
                                         <div class="aei-content" ng-if="$root.isDefined(issueHistory.issueHistoryType)">
-                                            <div dom-append dom="issueHistory.description"></div>
+                                            <div dom-append dom="issueHistory.desc"></div>
+                                        </div>
+
+                                        <!--    �뙎湲��씤 寃쎌슦  -->
+                                        <div class="aei-content pb-3" ng-if="!$root.isDefined(issueHistory.issueHistoryType)">
+                                            <div class="dot">
+                                                *�븯�쐞�씠�뒋 : {{::issueHistory.title}}
+                                            </div>
+                                        </div>
+                                        <div class="aei-image" style="position: absolute; top: 30%" ng-if="!$root.isDefined(issueHistory.issueHistoryType)">
+                                            <div class="user-avatar-w ">
+                                                <img style="margin-top: 15px" alt="image" ng-src="{{::issueHistory.profile}}">
+                                            </div>
+                                        </div>
+                                        <div class="aei-content" ng-if="!$root.isDefined(issueHistory.issueHistoryType)">
+                                            <h6 class="aei-title mt-1 ml-3per">
+                                                {{::issueHistory.registerName}}
+                                            </h6>
+                                            <div class="date-break mt-2" style="margin-left: 3.3%">
+                                                <span>{{::issueHistory.registerDate}}</span>
+                                            </div>
+                                            <div class="aei-delete"
+                                                 ng-click="fn.removeComment(issueHistory)"
+                                                 ng-show="vm.viewer.modifyPermissionCheck || $root.user.id == issueHistory.registerId">
+                                                <i class="os-icon os-icon-close"></i>
+                                            </div>
+                                            <div class="chat-messages">
+                                                <div class="message" style="margin-left: 3.3%">
+                                                    <div class="message-content">
+                                                        <span class="issue-detail-word-break">{{::issueHistory.description}}</span>
+                                                    </div>
+                                                </div>
+                                            </div>
                                         </div>
                                     </div>
                                 </div>

--
Gitblit v1.8.0