| | |
| | | var IspField = $injector.get("IspField"); |
| | | var HostingField = $injector.get("HostingField"); |
| | | var IssueType = $injector.get("IssueType"); |
| | | var IssueTypeCustomField = $injector.get("IssueTypeCustomField"); |
| | | var CustomField = $injector.get("CustomField"); |
| | | var $log = $injector.get("$log"); |
| | | var SweetAlert = $injector.get("SweetAlert"); |
| | |
| | | $scope.fn.getIssueTypeList = getIssueTypeList; // 이슈 유형 목록 조회 |
| | | $scope.fn.getCustomFieldList = getCustomFieldList; // 사용자 정의 필드 목록 조회 |
| | | $scope.fn.getMailTargetAll = getMailTargetAll; // 사용자 정의 필드 목록 조회 |
| | | $scope.fn.getIssueTypeCustomFieldList = getIssueTypeCustomFieldList; // 이슈 유형에서 사용중인 사용자정의 필드가져오기 |
| | | |
| | | function getUserList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | |
| | | |
| | | function getIssueDepartmentList(query, excludeList, page, callBack) { |
| | | var conditions = { |
| | | issueTypeId : $scope.vm.form.issueTypeId, |
| | | //issueTypeId : $scope.vm.form.issueTypeId, |
| | | issueTypeId : (function () { |
| | | var issueTypeId = ""; |
| | | if ($rootScope.currentDetailIssueId != null) { |
| | | issueTypeId = $rootScope.currentDetailIssueId; |
| | | } else { |
| | | issueTypeId = $scope.vm.form.issueTypeId; |
| | | } |
| | | return issueTypeId; |
| | | })(), |
| | | departmentName : query, |
| | | userId : $rootScope.user.id, |
| | | projectId : (function () { |
| | |
| | | conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | const departments = result.data.data; |
| | | var filterDepartments = departments.filter(function(item, idx){ |
| | | return departments.findIndex(function(item2, idx2){ |
| | | return item.departmentName === item2.departmentName |
| | | }) == idx; |
| | | }); |
| | | if(departments != null){ |
| | | var filterDepartments = departments.filter(function(item, idx){ |
| | | return departments.findIndex(function(item2, idx2){ |
| | | return item.departmentName === item2.departmentName |
| | | }) == idx; |
| | | }); |
| | | } |
| | | |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | // 이슈 유형에 연결된 사용자 정의 필드 |
| | | function getIssueTypeCustomFieldList(query, excludeList, projectId, issueTypeId, page, callBack) { |
| | | |
| | | if (projectId == null) return; |
| | | if (issueTypeId == null) return; |
| | | |
| | | var deferred = $q.defer(); |
| | | |
| | | IssueTypeCustomField.find($resourceProvider.getContent({ |
| | | name : query, |
| | | projectId : projectId, |
| | | issueTypeId : issueTypeId, |
| | | excludeIds : (function () { |
| | | var excludeIds = []; |
| | | |
| | | angular.forEach(excludeList, function (exclude) { |
| | | excludeIds.push(exclude.id); |
| | | }); |
| | | |
| | | return excludeIds; |
| | | })() |
| | | }, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | if ($rootScope.isDefined(callBack)) { |
| | | callBack(result); |
| | | } |
| | | |
| | | var customFields = result.data.data; |
| | | var customFieldVos = []; |
| | | customFields.forEach(function (customField) { |
| | | customFieldVos.push(customField.customFieldVo); |
| | | }) |
| | | |
| | | deferred.resolve(customFieldVos); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToUserDefinedFieldListAssociatedLookup"), result.data.message.message, "error"); // 이슈 유형에 연결된 사용자 정의 필드 목록 조회 실패 |
| | | } |
| | | |
| | | }); |
| | | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | function getMailTargetAll(excludeList) { |
| | | var deferred = $q.defer(); |
| | | |