| | |
| | | formCheck : formCheck, // 폼 체크 |
| | | getIssueTypes : getIssueTypes, // 이슈 타입 목록 가져오기 |
| | | makeSearchConditions : makeSearchConditions, // 선택한 조건을 json 으로 만든다. |
| | | onFileSelect : onFileSelect // 파일 업로드 |
| | | onFileSelect : onFileSelect, // 파일 업로드 |
| | | getIssueListCallBack : getIssueListCallBack // 이슈 autocomplete page 업데이트 |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | }, |
| | | projectName : "", |
| | | autoCompletePage : { |
| | | issue : { |
| | | page : 0, |
| | | totalPage : 0 |
| | | }, |
| | | project : { |
| | | page : 0, |
| | | totalPage : 0 |
| | |
| | | |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | // 이슈 autocomplete page 업데이트 |
| | | function getIssueListCallBack(result) { |
| | | $scope.vm.autoCompletePage.issue.totalPage = result.data.page.totalPage; |
| | | } |
| | | |
| | | $scope.$on("projectListEvent", function (event, result) { |
| | | $scope.vm.form.projects = result; |
| | | $scope.vm.form.issues = ""; |
| | | $scope.fn.getIssueTypes(); |
| | | }); |
| | | |
| | | // 이슈 유형 목록 |
| | | function getIssueTypes() { |
| | | IssueType.find($resourceProvider.getContent({}, |
| | | if (!$rootScope.isDefined($scope.vm.form.projects[0])) { |
| | | return; |
| | | } |
| | | IssueType.find($resourceProvider.getContent({projectId : $scope.vm.form.projects[0].id}, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | |
| | | return false; |
| | | } |
| | | |
| | | if ($scope.vm.form.issues == null || $scope.vm.form.issues.length === 0) { |
| | | /*if ($scope.vm.form.issues == null || $scope.vm.form.issues.length === 0) { |
| | | return false; |
| | | } |
| | | }*/ |
| | | |
| | | if ($scope.vm.form.file.length < 1) { |
| | | return true; |
| | |
| | | content : { |
| | | projectId : $scope.vm.form.projects[0].id, |
| | | issueTypeId : $scope.vm.form.issueTypeId, |
| | | parentIssueId : $scope.vm.form.issues[0].id |
| | | parentIssueId : (function () { |
| | | var id = -1; |
| | | if ($scope.vm.form.issues != null) { |
| | | id = $scope.vm.form.issues[0].id |
| | | } |
| | | return id; |
| | | })() |
| | | } |
| | | }, |
| | | fileFormDataName : "file" |
| | | }) |
| | | .then(function (result) { |
| | | }).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; |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | |