| | |
| | | |
| | | let inheritYn = false; |
| | | // 하위이슈 등록 & 파트너 정보 상속 일 경우 알림 창 |
| | | if ($rootScope.isDefined($scope.vm.form.issues) && $rootScope.isDefined($scope.vm.form.issues[0])) { |
| | | if ($scope.vm.form.issues[0].inheritPartners != null && $scope.vm.form.issues[0].inheritPartners === true) { |
| | | if ($rootScope.isDefined($scope.vm.form.issues) && $rootScope.isDefined($scope.vm.form.issues[0]) |
| | | && $scope.vm.form.issues[0].inheritPartners != null && $scope.vm.form.issues[0].inheritPartners === true) { |
| | | |
| | | 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; |
| | | } |
| | | SweetAlert.close(); |
| | | 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; |
| | | } |
| | | SweetAlert.close(); |
| | | |
| | | Issue.importExcel({ |
| | | method : "POST", |
| | | file : $scope.vm.form.file, |
| | | // data 속성으로 별도의 데이터 전송 |
| | | fields : { |
| | | content : { |
| | | projectId : $scope.vm.form.projects[0].id, |
| | | issueTypeId : $scope.vm.form.issueTypeId, |
| | | parentIssueId : (function () { |
| | | let id = -1; |
| | | if ($rootScope.isDefined($scope.vm.form.issues)) { |
| | | if ($rootScope.isDefined($scope.vm.form.issues[0])) { |
| | | id = $scope.vm.form.issues[0].id; |
| | | } |
| | | } |
| | | return id; |
| | | })(), |
| | | inheritYn : inheritYn |
| | | } |
| | | }, |
| | | fileFormDataName : "file", |
| | | }).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | $timeout(function () { |
| | | SweetAlert.success($filter("translate")("issue.succeededIssueRegistration"), result.data.message.message); // 이슈 등록 성공 |
| | | $scope.fn.cancel(); |
| | | $rootScope.$broadcast("getIssueList"); |
| | | $rootScope.spinner = false; |
| | | }, 1000); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueRegistration"), result.data.message.message); // 이슈 등록 실패 |
| | | $rootScope.spinner = false; |
| | | } |
| | | }); |
| | | }); |
| | | } else { |
| | | Issue.importExcel({ |
| | | method : "POST", |
| | | file : $scope.vm.form.file, |
| | |
| | | $rootScope.spinner = false; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | Issue.importExcel({ |
| | | method : "POST", |
| | | file : $scope.vm.form.file, |
| | | // data 속성으로 별도의 데이터 전송 |
| | | fields : { |
| | | content : { |
| | | projectId : $scope.vm.form.projects[0].id, |
| | | issueTypeId : $scope.vm.form.issueTypeId, |
| | | parentIssueId : (function () { |
| | | let id = -1; |
| | | if ($rootScope.isDefined($scope.vm.form.issues)) { |
| | | if ($rootScope.isDefined($scope.vm.form.issues[0])) { |
| | | id = $scope.vm.form.issues[0].id; |
| | | } |
| | | } |
| | | return id; |
| | | })(), |
| | | inheritYn : inheritYn |
| | | } |
| | | }, |
| | | fileFormDataName : "file", |
| | | }).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | $timeout(function () { |
| | | SweetAlert.success($filter("translate")("issue.succeededIssueRegistration"), result.data.message.message); // 이슈 등록 성공 |
| | | $scope.fn.cancel(); |
| | | $rootScope.$broadcast("getIssueList"); |
| | | $rootScope.spinner = false; |
| | | }, 1000); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueRegistration"), result.data.message.message); // 이슈 등록 실패 |
| | | $rootScope.spinner = false; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |