| | |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('issueAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', '$uibModal', '$injector', |
| | | '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'User', 'AttachedFile', 'IssueType', 'HostingField', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state', |
| | | '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'User', 'AttachedFile', 'IssueType', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, $uibModal, $injector, $controller, $tableProvider, SweetAlert, $timeout, |
| | | $stateParams, $q, Issue, User, AttachedFile, IssueType, HostingField, Priority, Severity, IssueTypeCustomField, $filter, $state) { |
| | | $stateParams, $q, Issue, User, AttachedFile, IssueType, Priority, Severity, IssueTypeCustomField, $filter, $state) { |
| | | |
| | | $scope.fn = { |
| | | cancel : cancel, // 팝업 창 닫기 |
| | |
| | | setIssueTypeTemplate : setIssueTypeTemplate, // 이슈 유형 템플릿 적용하기 |
| | | startExecute : startExecute, // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | containsPartner : containsPartner, |
| | | getPartners : getPartners, |
| | | getPartners : getPartners |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | function containsPartner(name) { |
| | | var result = false; |
| | | |
| | | if ($scope.vm.viewer.usePartnerVo != null) { |
| | | $scope.vm.viewer.usePartnerVo.forEach(function (partnerVo) { |
| | | if ($scope.vm.partnerVos != null) { |
| | | $scope.vm.partnerVos.forEach(function (partnerVo) { |
| | | if (name === partnerVo.name) { |
| | | result = true; |
| | | } |
| | |
| | | }, |
| | | 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; |
| | | }); |
| | | } |
| | | |
| | | // 팝업 창 닫기 |
| | |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | // 업체/ISP/호스팅 이름이 포함 여부 확인 |
| | | function containsPartner(name) { |
| | | var result = false; |
| | | |
| | | if ($scope.vm.partnerVos != null) { |
| | | $scope.vm.partnerVos.forEach(function (partnerVo) { |
| | | if (name === partnerVo.name) { |
| | | result = true; |
| | | } |
| | | }); |
| | | } |
| | | return result; |
| | | |
| | | } |
| | | |
| | | |
| | | // 중요도 목록 |
| | | function getSeverities() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | function getPartners() { |
| | | var content = { |
| | | issueTypeId : $scope.vm.form.issueTypeId |
| | |
| | | |
| | | $scope.fn.startExecute(); |
| | | }]); |
| | | }); |
| | | }); |