| | |
| | | }; |
| | | |
| | | $scope.vm = { |
| | | partnerVos : "", |
| | | form : { |
| | | title : "", // 제목 |
| | | description : "", // 내용 |
| | |
| | | // 이슈 유형에 연결된 사용자 정의 필드 가져오기 |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | | } |
| | | }); |
| | | |
| | | $scope.$watch("vm.form.issueTypeId", function (newValue, oldValue) { |
| | | $scope.vm.partnerVos = $scope.fn.getPartners(); |
| | | }); |
| | | |
| | | // 섬머노트 이미지 업로드 |
| | |
| | | }, |
| | | fileFormDataName : "file" |
| | | }).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | // 연속 등록 체크시 이동하지 않음. |
| | | if ($scope.vm.infiniteAdd) { |
| | | $scope.fn.infiniteAddForm(); |
| | | } |
| | | else { |
| | | $scope.fn.cancel(); |
| | | |
| | | if ($state.current.name !== "issues.list" || $state.current.name === "issues.list") { |
| | | $state.go("issues.list"); |
| | | } |
| | | } |
| | | |
| | | $rootScope.$broadcast("getIssueList", {}); |
| | | if (result.data.message.status === "success") { |
| | | // 연속 등록 체크시 이동하지 않음. |
| | | if ($scope.vm.infiniteAdd) { |
| | | $scope.fn.infiniteAddForm(); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueRegistration"), result.data.message.message); // 이슈 등록 실패 |
| | | $scope.fn.cancel(); |
| | | |
| | | if ($state.current.name !== "issues.list" || $state.current.name === "issues.list") { |
| | | $state.go("issues.list"); |
| | | } |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | $rootScope.$broadcast("getIssueList", {}); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueRegistration"), result.data.message.message); // 이슈 등록 실패 |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | |
| | | // 팝업 창 닫기 |
| | |
| | | angular.forEach(result.data.data, function (issueTypeCustomField) { |
| | | switch (issueTypeCustomField.customFieldVo.customFieldType) { |
| | | case "INPUT" : |
| | | case "NUMBER" : |
| | | case "DATETIME" : |
| | | case "IP_ADDRESS" : |
| | | case "EMAIL" : |
| | | case "SITE" : |
| | | case "TEL" : |
| | | issueTypeCustomField.useValues = issueTypeCustomField.customFieldVo.defaultValue; |
| | | break; |
| | | case "SINGLE_SELECT" : |
| | |
| | | } |
| | | |
| | | function getPartners() { |
| | | |
| | | HostingField.getPartnerList($resourceProvider.getContent( |
| | | {}, |
| | | var content = { |
| | | issueTypeId : $scope.vm.form.issueTypeId |
| | | }; |
| | | Issue.findPartners($resourceProvider.getContent( |
| | | content, |
| | | $resourceProvider.getPageContent(0, 1))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.partnerVos = result.data.content; |
| | | $scope.vm.partnerVos = result.data.data; |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | // 최초 실행 |
| | | function startExecute() { |
| | |
| | | var promises = { |
| | | getIssueTypes : $scope.fn.getIssueTypes(), |
| | | getPriorities : $scope.fn.getPriorities(), |
| | | getSeverities : $scope.fn.getSeverities() |
| | | getSeverities : $scope.fn.getSeverities(), |
| | | getPartners : $scope.fn.getPartners() |
| | | }; |
| | | $q.all(promises).then(function (results) { |
| | | // 현재 프로젝트 설정 |
| | |
| | | $scope.fn.projects.push($rootScope.workProject); |
| | | $scope.fn.getProjectList($scope.vm.projectName, $scope.vm.form.projects, $scope.vm.autoCompletePage.project.page, getStartProjectListCallback); |
| | | } |
| | | |
| | | // 현재 이슈타입 유형 설정 |
| | | var id = $rootScope.getCurrentIssueTypeId(); |
| | | if (id != null) { |
| | | $scope.vm.form.issueTypeId = id.toString(); |
| | | } |
| | | $log.debug("promises 결과 ", results); |
| | | }); |
| | | } |
| | | |
| | | $scope.fn.startExecute(); |
| | | }]); |
| | | }); |
| | | }); |