From e2c9d5c6cc9bf4a4314dcbce17e1336e8f78ebf8 Mon Sep 17 00:00:00 2001 From: wyu <kknd09321@nate.com> Date: 목, 16 12월 2021 11:20:10 +0900 Subject: [PATCH] 사이드바 프로필 사용자등급, 부서표시 --- src/main/webapp/scripts/config.js | 107 ++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 84 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/scripts/config.js b/src/main/webapp/scripts/config.js index 47b5db7..44c2d61 100644 --- a/src/main/webapp/scripts/config.js +++ b/src/main/webapp/scripts/config.js @@ -61,11 +61,20 @@ // 臾몄쓽�븯湲� $rootScope.information = false; + // �궗�슜�옄 �벑湲됰챸 + $rootScope.myLevel = ""; + + // 遺��꽌紐� + $rootScope.myDepartments = ""; + // PrimaryWorkspace $rootScope.hasPrimaryWorkspace = false; // 理쒓퀬愿�由ъ옄 議댁옱 �뿬遺� $rootScope.hasSuperUser = false; + + // 硫붿씤 寃��깋 �뿬遺� + $rootScope.isMainSearch = false; // ���떆蹂대뱶 �꽑�깮 0:�쟾泥� 1:�봽濡쒖젥�듃 $rootScope.dashboard = 0; @@ -129,6 +138,7 @@ return true; }; + // �씠�뒋 �깮�꽦, �닔�젙�뿉�꽌 �떎以� �꽑�깮, �떒�씪 �꽑�깮 �샃�뀡�뿉 泥댄겕�릺寃� �빐二쇰뒗 湲곕뒫 $rootScope.selectOption = function (useValues, value) { @@ -235,11 +245,12 @@ // 沅뚰븳 由ъ뒪�듃 $rootScope.mngPermission = { - "USER_PERMISSION_MNG_PARTNER" : 8192, - "USER_PERMISSION_MNG_WORKSPACE" : 4096, - "USER_PERMISSION_MNG_PROJECT" : 2048, + "USER_PERMISSION_MNG_WORKSPACE" : 16384, + "USER_PERMISSION_MNG_PROJECT" : 8192, + "USER_PERMISSION_MNG_ISSUE" : 4096, + "USER_PERMISSION_MNG_PARTNER" : 2048, "USER_PERMISSION_MNG_API" : 1024, - "USER_PERMISSION_MNG_ISSUE_STATUS" : 512, + "USER_PERMISSION_MNG_ISSUE_SYSTEM" : 512, "USER_PERMISSION_MNG_WORKFLOW" : 256, "USER_PERMISSION_MNG_CUSTOME_FIELD" : 128, "USER_PERMISSION_MNG_ISSUE_TYPE" : 64, @@ -249,6 +260,18 @@ "USER_PERMISSION_MNG_EVENT" : 4, "USER_PERMISSION_MNG_GUIDE" : 2, }; + + // �쁽�옱 �꽑�깮�맂 �씠�뒋 ���엯 �븘�씠�뵒 媛��졇�삤湲� + $rootScope.getCurrentIssueTypeId = function () { + return $rootScope.issueTypeMenu != null ? $rootScope.issueTypeMenu.id : null; + } + + // �쁽�옱 �꽑�깮�맂 �씠�뒋 ���엯 蹂�寃쏀븯湲� + $rootScope.setCurrentIssueTypeId = function (issueTypeVo) { + if($rootScope.issueTypeMenu !== issueTypeVo) { + $rootScope.issueTypeMenu = issueTypeVo; + } + } // 沅뚰븳�쓣 �솗�씤�븳�떎 $rootScope.checkMngPermission = function (userPermission) { @@ -264,6 +287,34 @@ return false; }; + + $rootScope.getMyInfo = function () { + + User.findMyLevelAndDepartment($resourceProvider.getContent({}, + $resourceProvider.getPageContent(0, 0))).then(function (result) { + + if (result.data.message.status === "success") { + $rootScope.myLevel = result.data.data.levelName + $rootScope.myDepartments = result.data.data.departmentName + } + }); + } + // �궗�슜�옄 �젙蹂대�� 媛��졇�삩�떎. + $rootScope.getMyInfo(); + + /*$rootScope.checkMngPermissionViewIssueAndProject = function (userPermission) { + if (!$rootScope.isDefined($rootScope.user)) { + return false; + } + + var permissionVal = $rootScope.mngPermission[userPermission]; + + if (($rootScope.user.permission & permissionVal) !== 0) { + return true; + } + + return false; + };*/ // setting 愿�由ъ옄�씤吏� �솗�씤�븳�떎. $rootScope.checkMngPermissionSettings = function () { @@ -304,28 +355,33 @@ return false; }; - $rootScope.changeLastProject = function (projectId, reload = true) { - if (User != null) { - User.updateLastProject($resourceProvider.getContent( - {lastProjectId: projectId}, - $resourceProvider.getPageContent(0, 0))).then(function (result) { + $rootScope.changeLastProject = function (projectId, reload = true, onEvent = true) { + if ($rootScope.workProject == null || $rootScope.workProject.id !== projectId ) { + if (User != null) { + User.updateLastProject($resourceProvider.getContent( + {lastProjectId: projectId}, + $resourceProvider.getPageContent(0, 0))).then(function (result) { - if (result.data.message.status === "success") { - $rootScope.user = result.data.data; - $rootScope.projects.forEach(function (el) { - if (el.id == projectId) { - $rootScope.workProject = el; - - $rootScope.$broadcast("changeLastProject", { id : el.id }); - } - }); - $state.go($state.current, {}, {reload: reload}); - } - }); + if (result.data.message.status === "success") { + $rootScope.user = result.data.data; + $rootScope.projects.forEach(function (el) { + if (el.id == projectId) { + $rootScope.workProject = el; + if (onEvent) { + $rootScope.$broadcast("changedLastProject", {id: el.id}); + $state.go("issues.list"); + } + if (reload) { + $state.go('dashboards.dashboard'); + } + } + }); + // $state.go($state.current, {}, {reload: reload}); + } + }); + } } }; - - // �봽濡쒖젥�듃 愿�由� 沅뚰븳�씠 �엳�뒗吏� �솗�씤�븳�떎 $rootScope.checkMngPermissionProject = function () { @@ -467,6 +523,11 @@ $("#page-container").trigger("click"); $("body").unbind("click"); + // �씠�뒋 寃��깋 �럹�씠吏��뿉�꽌 踰쀬뼱�궇 寃쎌슦 泥섎━ + if ($rootScope.isMainSearch) { + $rootScope.isMainSearch = false; + } + var $uibModalStack = $injector.get('$uibModalStack'); $uibModalStack.dismissAll(); -- Gitblit v1.8.0