| | |
| | | 'angular' |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('issueAddRelationTableConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', 'SweetAlert', '$timeout', 'IssueTableConfig', 'CustomField', '$q', '$filter', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, SweetAlert, $timeout, IssueTableConfig, CustomField, $q, $filter) { |
| | | app.controller('issueAddRelationTableConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', 'SweetAlert', '$timeout', 'IssueTableConfig', 'IssueTypeCustomField', '$q', '$filter', 'parameter', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, SweetAlert, $timeout, IssueTableConfig, IssueTypeCustomField, $q, $filter, parameter) { |
| | | |
| | | |
| | | // 함수 모음 |
| | |
| | | |
| | | // 변수 모음 |
| | | $scope.vm = { |
| | | issueId: "", |
| | | issueTypeId: "", |
| | | issueRelTableConfigs : [{ |
| | | name : $filter("translate")("issue.relationIssueType"), // 연관 이슈 구분 |
| | | key : "RELATION_ISSUE_TYPE", |
| | | width : "width-60-p", |
| | | position : 0, |
| | | display : true, |
| | | checkboxShow : false |
| | | }, { |
| | | name : $filter("translate")("issue.relationIssueTitle"), // 연관 이슈 제목 |
| | | key : "RELATION_ISSUE_TITLE", |
| | | width : "width-60-p", |
| | | position : 0, |
| | | display : true, |
| | | checkboxShow : false |
| | | }, { |
| | | name : $filter("translate")("common.priority"), // 우선순위 |
| | | key : "PRIORITY", |
| | | width : "width-100-p", |
| | | key : "RELATION_PRIORITY", |
| | | width : "width-50-p", |
| | | position : 1, |
| | | display : true |
| | | display : false, |
| | | checkboxShow : true |
| | | }, { |
| | | name : $filter("translate")("common.importance"), // 중요도 |
| | | key : "SEVERITY", |
| | | width : "width-100-p", |
| | | key : "RELATION_SEVERITY", |
| | | width : "width-50-p", |
| | | position : 2, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("issue.issueType"), // 이슈 타입 |
| | | key : "ISSUE_TYPE", |
| | | width : "width-100-p", |
| | | position : 3, |
| | | display : true |
| | | display : false, |
| | | checkboxShow : true |
| | | }, { |
| | | name : $filter("translate")("common.assigneeTeam"), // 담당부서 |
| | | key : "ASSIGNEE_TEAM", |
| | | key : "RELATION_ASSIGNEE_TEAM", |
| | | width : "width-50-p", |
| | | position : 4, |
| | | display : true |
| | | position : 3, |
| | | display : false, |
| | | checkboxShow : true |
| | | }, { |
| | | name : $filter("translate")("common.register"), // 등록자 |
| | | key : "REGISTER", |
| | | key : "RELATION_REGISTER", |
| | | width : "width-50-p", |
| | | position : 5, |
| | | display : true |
| | | position : 4, |
| | | display : false, |
| | | checkboxShow : true |
| | | }, { |
| | | name : $filter("translate")("common.period"), // 기간 |
| | | key : "PERIOD", |
| | | key : "RELATION_PERIOD", |
| | | width : "width-100-p", |
| | | position : 6, |
| | | display : true |
| | | position : 5, |
| | | display : false, |
| | | checkboxShow : true |
| | | }, { |
| | | name : $filter("translate")("common.lastChangeDate"), // 최근 변경일 |
| | | key : "MODIFY_DATE", |
| | | key : "RELATION_MODIFY_DATE", |
| | | width : "width-100-p", |
| | | position : 7, |
| | | display : true |
| | | position : 6, |
| | | display : false, |
| | | checkboxShow : true |
| | | }, { |
| | | }] |
| | | }; |
| | |
| | | $rootScope.spinner = true; |
| | | |
| | | var content = { |
| | | issueId : $rootScope.currentDetailIssueId, |
| | | issueTypeId : $rootScope.getCurrentIssueTypeId(), |
| | | issueTableConfigs : JSON.stringify($scope.vm.issueRelTableConfigs) |
| | | }; |
| | | |
| | |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedToSaveIssueTableSetting"), result.data.message.message); // 이슈 테이블 설정 저장 실패 |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | |
| | |
| | | function getCustomFields() { |
| | | var deferred = $q.defer(); |
| | | |
| | | CustomField.find($resourceProvider.getContent({}, |
| | | IssueTypeCustomField.findByIssueType($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()}, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | if (result.data.message.status !== "success") { |
| | | SweetAlert.error($filter("translate")("issue.failedToUserDefinedFieldListLookup"), result.data.message.message); // 사용자 정의 필드 목록 조회 실패 |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | |
| | | |
| | | // 이슈 목록 테이블 설정 정보를 가져온다. |
| | | function getRelIssueTableConfigs() { |
| | | var deferred = $q.defer(); |
| | | |
| | | var content = { |
| | | issueId : $rootScope.currentDetailIssueId, |
| | | issueTypeId : $rootScope.getCurrentIssueTypeId(), |
| | | delValue : $scope.vm.issueRelTableConfigs.splice(8,1), |
| | | issueTableConfigs : JSON.stringify($scope.vm.issueRelTableConfigs) |
| | | }; |
| | | |
| | |
| | | |
| | | // 사용자 정의 필드를 조회한 후 표시할 이슈 테이블 컬럼을 준비한다. |
| | | $scope.fn.getCustomFields().then(function (result) { |
| | | var count = 9; |
| | | var count = 8; |
| | | angular.forEach(result, function (customField) { |
| | | $scope.vm.issueRelTableConfigs.push({ |
| | | name : customField.name, |
| | | key : "CUSTOM_FIELD_" + customField.id, |
| | | width : "width-100-p", |
| | | display : false, |
| | | checkboxShow : true, |
| | | position : count |
| | | }); |
| | | |
| | |
| | | if ($rootScope.isDefined(issueTableConfigs)) { |
| | | $rootScope.spinner = true; |
| | | |
| | | // var saveTableConfigs = JSON.parse(issueTableConfigs); |
| | | var saveTableConfigs = JSON.parse(issueTableConfigs); |
| | | |
| | | angular.forEach(saveTableConfigs, function (saveTableConfig) { |