| | |
| | | function makeActiveHistory() { |
| | | $scope.vm.viewer.activeParentHistory = ""; |
| | | $scope.vm.viewer.activeHistory = ""; |
| | | $scope.vm.viewer.activeParentMailHistory = ""; |
| | | var oriMailHistory = []; |
| | | |
| | | 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); |
| | | } |
| | | |
| | | 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 = ""; //하위이슈 히스토리+댓글 |
| | | var downTitle = ""; |
| | | var oriDownHistory = []; |
| | | var oriDownCommentHistory = []; |
| | | var oriDownMailHistory = []; |
| | | |
| | | // 하위이슈 히스토리 |
| | | 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++) { |
| | | if($scope.vm.viewer.issueDownVos[i].issueHistoryVos[j].issueHistoryType === "SEND") { |
| | | oriDownMailHistory.push($scope.vm.viewer.issueDownVos[i].issueHistoryVos[j]); |
| | | } |
| | | } |
| | | } |
| | | // 하위이슈 메일만 저장 |
| | | $scope.vm.viewer.activeDownMailHistory = angular.copy(oriDownMailHistory); |
| | | $scope.vm.viewer.activeDownMailHistory.sort(function (a, b) { //내림차순 |
| | | 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]; |