| | |
| | | moveMenu : moveMenu, |
| | | findIssueList : findIssueList, // 사이드바 이슈 목록 가져오기 |
| | | changeIssueListMenu : changeIssueListMenu, |
| | | setLastIssueType : setLastIssueType |
| | | setLastIssueType : setLastIssueType, |
| | | searchAll : searchAll // 상단 검색 |
| | | }; |
| | | |
| | | $scope.vm = { |
| | | workProject : -1, |
| | | message: "", |
| | | workProjectId : -1 |
| | | workProjectId : -1, |
| | | searchAll : { |
| | | keyWord : "" |
| | | } |
| | | }; |
| | | |
| | | |
| | | // session check after route |
| | | $rootScope.$on("$stateChangeStart", function (event, toState, toStateParams) { |
| | | if (!$rootScope.isMainSearch) { |
| | | $scope.vm.searchAll.keyWord = ""; |
| | | } |
| | | }); |
| | | |
| | | // 시스템에서 특정 이슈로 바로 이동할 수 있도록 해준다. |
| | | $scope.$on("makeIssueSearch", function (event, args) { |
| | |
| | | $scope.fn.findIssueList($rootScope.workProject.id); |
| | | //} |
| | | }); |
| | | |
| | | // 메인 상단 검색 |
| | | function searchAll() { |
| | | $rootScope.isMainSearch = true; |
| | | |
| | | if ($state.current.name !== "issues.list" || $state.current.name === "issues.list") { |
| | | $state.go("issues.list"); |
| | | } |
| | | |
| | | $scope.$broadcast("searchIssueList", {keyWord: $scope.vm.searchAll.keyWord}); |
| | | } |
| | | |
| | | function setLastIssueType() { |
| | | if (User != null) { |
| | |
| | | if ($rootScope.user.lastIssueTypeId !== issueTypeId) { |
| | | $scope.fn.setLastIssueType(issueTypeId); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | function moveMenu(stateName) { |
| | |
| | | } |
| | | |
| | | var id = $rootScope.workProject.id === -1 ? null : $rootScope.workProject.id; |
| | | $scope.fn.findIssueList(id); |
| | | } |
| | | $rootScope.projects = datas; |
| | | $scope.fn.findIssueList(id); |
| | | } |
| | | |
| | | if ($rootScope.user.lastProjectId == null) { |
| | |
| | | |
| | | // 이슈 유형 목록 가져오기 |
| | | function findIssueList(projectId) { |
| | | |
| | | if ($rootScope.projects == null || $rootScope.projects.length <= 1) |
| | | return; |
| | | |
| | | // 이슈 타입 목록 검색 조건을 만든다. |
| | | var conditions = { |
| | | projectId : projectId > -1 ? projectId : null, |
| | |
| | | if ($rootScope.workIssueTypes != null && $rootScope.workIssueTypes.length > 0) { |
| | | $rootScope.workIssueTypes.forEach(function (issueType) { |
| | | |
| | | var selectIssueTypeId = null; |
| | | //var selectIssueTypeId = null; |
| | | if (issueType.id === $rootScope.user.lastIssueTypeId) { |
| | | selectIssueTypeId = issueType.id; |
| | | //selectIssueTypeId = issueType.id; |
| | | $scope.fn.changeIssueListMenu(issueType.id, false); |
| | | // $state.go('dashboards.dashboard'); |
| | | } |
| | | |
| | | if (selectIssueTypeId == null) { |
| | | $scope.fn.changeIssueListMenu($rootScope.workIssueTypes[0].id, false); |
| | | |
| | | // 이슈목록 새로고침 목록 갱신 |
| | | $scope.$broadcast("findIssueListOK", { myIssueType : issueType} ); |
| | | } |
| | | }); |
| | | } |
| | | // 대쉬보드로 가는데 프로젝트를 생성하거나 수정해도 걸리는 조건이다. |
| | | // else { |
| | | // $state.go('dashboards.dashboard'); |
| | | // } |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("managementType.failedToIssueTypeList"), result.data.message.message); // "이슈 유형 목록 조회 실패" |