| | |
| | | function (app, angular) { |
| | | |
| | | app.controller('commonController', ['$scope', '$rootScope', '$log', 'Auth', '$state', 'User', '$resourceProvider', '$uibModal', 'SweetAlert', 'Workspace', '$translate', '$q', |
| | | '$interval', 'IssueSearch', '$filter', 'Notice', 'Project', 'IssueType', |
| | | function ($scope, $rootScope, $log, Auth, $state, User, $resourceProvider, $uibModal, SweetAlert, Workspace, $translate, $q, $interval, IssueSearch, $filter, Notice, Project, IssueType) { |
| | | '$controller', '$injector', '$interval', 'IssueSearch', '$filter', 'Notice', 'Project', 'IssueType', |
| | | function ($scope, $rootScope, $log, Auth, $state, User, $resourceProvider, $uibModal, SweetAlert, Workspace, $translate, $q, $controller, $injector, $interval, IssueSearch, $filter, Notice, Project, IssueType) { |
| | | |
| | | $scope.fn = { |
| | | logout: logout, // 로그아웃 |
| | |
| | | findIssueList : findIssueList, // 사이드바 이슈 목록 가져오기 |
| | | changeIssueListMenu : changeIssueListMenu, |
| | | setLastIssueType : setLastIssueType, |
| | | searchAll : searchAll // 상단 검색 |
| | | searchAll : searchAll, // 상단 검색 |
| | | sendCommonMail : sendCommonMail |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | keyWord : "" |
| | | } |
| | | }; |
| | | |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | // 시스템에서 특정 이슈로 바로 이동할 수 있도록 해준다. |
| | | $scope.$on("makeIssueSearch", function (event, args) { |
| | |
| | | //} |
| | | }); |
| | | |
| | | $rootScope.$on("$stateChangeStart", function (event, toState, toStateParams) { |
| | | var keyWord = $rootScope.getCookie("searchKeyword"); |
| | | |
| | | if (keyWord == null || keyWord === '') { |
| | | $scope.vm.searchAll.keyWord = ""; |
| | | } |
| | | }); |
| | | |
| | | // 일반 메일 발송 (사용자 직접 작성) |
| | | function sendCommonMail() { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/issue/issueCommonSendMail.html', |
| | | size : "md", |
| | | controller : 'issueCommonSendMailController', |
| | | backdrop : 'static', |
| | | resolve : { |
| | | parameter : { |
| | | issueId : null, |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 메인 상단 검색 |
| | | function searchAll() { |
| | | if ($state.current.name !== "issues.list") { |
| | | // $state.go("issues.list"); |
| | | var myUrl = window.location.href.split('#/'); |
| | | location.href = myUrl[0] + "#/issues/issueList?keyWord=" + $scope.vm.searchAll.keyWord; |
| | | if ($rootScope.isDefined($scope.vm.searchAll.keyWord)) { |
| | | $rootScope.setCookie("searchKeyword", $scope.vm.searchAll.keyWord, 60000); |
| | | moveMenu("issues.list"); |
| | | } else { |
| | | $scope.$broadcast("searchIssueList", {keyWord: $scope.vm.searchAll.keyWord}); |
| | | SweetAlert.warning($filter("translate")("common.alertSystem"), $filter("translate")("issue.pleaseEnterIssueKeyWord")); |
| | | } |
| | | //$scope.vm.searchAll.keyWord = ""; |
| | | //$rootScope.previousGetParams = null; |
| | | } |
| | | |
| | | function setLastIssueType() { |
| | |
| | | |
| | | function changeIssueListMenu(issueTypeId, changeProject = true) { |
| | | $rootScope.issueTypeMenu = null; |
| | | for (var issueType of $rootScope.workIssueTypes) { |
| | | if (issueType.id === issueTypeId) { |
| | | $rootScope.issueTypeMenu = issueType; |
| | | break; |
| | | $rootScope.allIssueList = false; |
| | | if (issueTypeId == null) { |
| | | $rootScope.allIssueList = true; |
| | | $rootScope.isMainSearch = false; //상세검색 표시 |
| | | moveMenu("issues.list"); |
| | | }else { |
| | | for (var issueType of $rootScope.workIssueTypes) { |
| | | if (issueType.id === issueTypeId) { |
| | | $rootScope.issueTypeMenu = issueType; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if (changeProject) { |
| | | |
| | | $rootScope.$broadcast("changedIssueListMenu", $rootScope.issueTypeMenu); |
| | | $rootScope.changeLastProject($rootScope.issueTypeMenu.projectVo.id, false, false); |
| | | //$rootScope.changeLastProject($rootScope.issueTypeMenu.projectVo.id, false, false); |
| | | |
| | | if ($rootScope.issueTypeMenu != null) { |
| | | moveMenu("issues.list"); |
| | |
| | | }); |
| | | }); |
| | | |
| | | // 사용자 관리 - 사용자 등급 변경 했을 때 |
| | | $rootScope.webSocket.client.subscribe('/user/notification/changeUserLevel', function (notification) { |
| | | SweetAlert.warning($filter("translate")("common.changeUserLevel"), $filter("translate")("common.logoutForLevelChange")); |
| | | $rootScope.$broadcast("logout"); |
| | | }); |
| | | |
| | | // 사용자 관리 - 사용자 부서 변경 했을 때 |
| | | $rootScope.webSocket.client.subscribe('/user/notification/changeUserDepartment', function (notification) { |
| | | SweetAlert.warning($filter("translate")("common.changeUserDepartment"), $filter("translate")("common.logoutForDepartmentChange")); |
| | | $rootScope.$broadcast("logout"); |
| | | }); |
| | | |
| | | // 참여 업무 공간 비활성화 알림 - 해당 업무 공간를 보고 있을 때 |
| | | $rootScope.webSocket.client.subscribe('/user/notification/workspace-disabled', function (notification) { |
| | | // edit by zenith at 20200801 |