| | |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('issueAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', '$uibModal', '$injector', |
| | | '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'User', 'AttachedFile', 'IssueType', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state', |
| | | '$controller', '$tableProvider', 'SweetAlert', '$timeout', '$stateParams', '$q', 'Issue', 'User', 'AttachedFile', 'Project', 'IssueType', 'Priority', 'Severity', 'IssueTypeCustomField', '$filter', '$state', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, $uibModal, $injector, $controller, $tableProvider, SweetAlert, $timeout, |
| | | $stateParams, $q, Issue, User, AttachedFile, IssueType, Priority, Severity, IssueTypeCustomField, $filter, $state) { |
| | | $stateParams, $q, Issue, User, AttachedFile, Project, IssueType, Priority, Severity, IssueTypeCustomField, $filter, $state) { |
| | | |
| | | $scope.fn = { |
| | | cancel : cancel, // 팝업 창 닫기 |
| | |
| | | onFileSelect : onFileSelect, // 파일 첨부 |
| | | infiniteAddForm : infiniteAddForm, // 계속 생성 |
| | | imageUpload : imageUpload, // 섬머노트 이미지 업로드 |
| | | getProject : getProject, //프로젝트 가져오기(전체 프로젝트 일 경우 사용) |
| | | getIssueTypes : getIssueTypes, // 이슈 타입 목록 가져오기 |
| | | getPriorities : getPriorities, // 우선순위 목록 가져오기 |
| | | getSeverities : getSeverities, // 중요도 목록 가져오기 |
| | |
| | | $scope.vm.hostingMemo = result[0].memo; |
| | | }); |
| | | |
| | | $scope.$on("companyTypeEvent", function (event, result) { |
| | | $scope.vm.form.companyTypeId = result[0].id; |
| | | }); |
| | | $scope.$on("parentSectorEvent", function (event, result) { |
| | | if ($rootScope.isDefined(result[0])) { |
| | | $scope.vm.form.parentSectorId = result[0].id; |
| | | } |
| | | |
| | | $scope.vm.form.childSector = ""; |
| | | $scope.vm.form.childSectors = []; |
| | | }); |
| | | $scope.$on("childSectorEvent", function (event, result) { |
| | | $scope.vm.form.childSectorId = result[0].id; |
| | | }); |
| | | $scope.$on("regionEvent", function (event, result) { |
| | | $scope.vm.form.regionId = result[0].id; |
| | | }); |
| | | $scope.$on("statusEvent", function (event, result) { |
| | | $scope.vm.form.statusId = result[0].id; |
| | | }); |
| | | |
| | | // 폼 전송 |
| | | function formSubmit() { |
| | | $rootScope.spinner = true; |
| | |
| | | issueCompanyFields : (function () { |
| | | var issueCompanyFields = []; |
| | | if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0 ){ |
| | | var companyField = $scope.vm.form.issueCompanyFields[0]; |
| | | issueCompanyFields.push({ |
| | | companyId : $scope.vm.companyId, |
| | | name : $scope.vm.companyName, |
| | |
| | | email :$scope.vm.companyEmail, |
| | | url :$scope.vm.companyUrl, |
| | | memo : $scope.vm.companyMemo, |
| | | companyTypeId : companyField.companyTypeId, |
| | | parentSectorId : companyField.parentSectorId, |
| | | childSectorId : companyField.childSectorId, |
| | | regionId : companyField.regionId, |
| | | statusId : companyField.statusId |
| | | companyTypeId : $scope.vm.form.companyTypeId, |
| | | parentSectorId : $scope.vm.form.parentSectorId, |
| | | childSectorId : $scope.vm.form.childSectorId, |
| | | regionId : $scope.vm.form.regionId, |
| | | statusId : $scope.vm.form.statusId |
| | | }); |
| | | } |
| | | return issueCompanyFields; |
| | |
| | | $(document).unbind("keydown"); // 단축키 이벤트 제거 |
| | | } |
| | | |
| | | // 프로젝트 가져오기(전체 프로젝트 일 경우 사용) |
| | | function getProject() { |
| | | var deferred = $q.defer(); |
| | | |
| | | Project.findIssueType($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()}, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(result.data.data)) { |
| | | $scope.vm.form.projects.push(result.data.data); |
| | | $scope.vm.projectName = result.data.data.name; |
| | | $scope.fn.getIssueTypeOfProject(); |
| | | } |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToIssueTypeListLookup"), result.data.message.message, "error"); // 이슈 타입 목록 조회 실패 |
| | | } |
| | | |
| | | deferred.resolve(result.data.data); |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | // 이슈 유형 목록 |
| | | function getIssueTypes() { |
| | | var deferred = $q.defer(); |
| | |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.issueTypes = result.data.data; |
| | | //$scope.fn.getIssueTypeCustomFields(); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToIssueTypeListLookup"), result.data.message.message, "error"); // 이슈 타입 목록 조회 실패 |
| | |
| | | } |
| | | |
| | | function getPartners() { |
| | | if($scope.vm.form.issueTypeId === ""){ |
| | | if($scope.vm.form.issueTypeId === "" && $rootScope.issueTypeMenu != null){ |
| | | $scope.vm.form.issueTypeId = $rootScope.issueTypeMenu.id |
| | | } |
| | | var content = { |
| | |
| | | } |
| | | |
| | | function getDepartments() { |
| | | if($scope.vm.form.issueTypeId === ""){ |
| | | if($scope.vm.form.issueTypeId === "" && $rootScope.issueTypeMenu != null){ |
| | | $scope.vm.form.issueTypeId = $rootScope.issueTypeMenu.id |
| | | } |
| | | var content = { |
| | |
| | | function startExecute() { |
| | | |
| | | var promises = { |
| | | getProject : $scope.fn.getProject(), |
| | | getIssueTypes : $scope.fn.getIssueTypes(), |
| | | getPriorities : $scope.fn.getPriorities(), |
| | | getSeverities : $scope.fn.getSeverities(), |