From 663ea2f2eca3b7da3bdaffb13eaac44433adb62f Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 목, 16 12월 2021 13:13:54 +0900
Subject: [PATCH] 기록탭 html 태그 보이는 내용 수정 / 사이드바 사용자 프로필 등급, 부서명 표시 수정

---
 src/main/webapp/scripts/config.js |  108 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 89 insertions(+), 19 deletions(-)

diff --git a/src/main/webapp/scripts/config.js b/src/main/webapp/scripts/config.js
index 39cf630..3622771 100644
--- a/src/main/webapp/scripts/config.js
+++ b/src/main/webapp/scripts/config.js
@@ -52,16 +52,29 @@
                 $rootScope.projects = [];
                 //  �쁽�옱 �궗�슜以묒씤 �봽濡쒖젥�듃
                 $rootScope.workProject = null;
+                //  �쁽�옱 �봽濡쒖젥�듃�뿉 �궗�슜以묒씤 �씠�뒋 紐⑸줉(�쑀�삎)
+                $rootScope.workIssueTypes = [];
+                //  �쁽�옱 �꽑�깮以묒씤 �씠�뒋 紐⑸줉
+                $rootScope.issueTypeMenu = null;
                 //  �씠�뒋 紐⑸줉->�긽�꽭�솕硫댁뿉�꽌 留덉�留됱쑝濡� �젒洹쇳븳 �씠�뒋 �븘�씠�뵒 - �씪�슦�듃 �깉�븣留덈떎 珥덇린�솕
                 $rootScope.currentDetailIssueId = null;
                 //  臾몄쓽�븯湲�
                 $rootScope.information = false;
+
+                // �궗�슜�옄 �벑湲됰챸
+                $rootScope.myLevel = "";
+
+                // 遺��꽌紐�
+                $rootScope.myDepartments = "";
 
                 //  PrimaryWorkspace
                 $rootScope.hasPrimaryWorkspace = false;
 
                 //  理쒓퀬愿�由ъ옄 議댁옱 �뿬遺�
                 $rootScope.hasSuperUser = false;
+
+                //  硫붿씤 寃��깋 �뿬遺�
+                $rootScope.isMainSearch = false;
 
                 // ���떆蹂대뱶 �꽑�깮 0:�쟾泥� 1:�봽濡쒖젥�듃
                 $rootScope.dashboard = 0;
@@ -125,6 +138,7 @@
 
                     return true;
                 };
+
 
                 //  �씠�뒋 �깮�꽦, �닔�젙�뿉�꽌 �떎以� �꽑�깮, �떒�씪 �꽑�깮 �샃�뀡�뿉 泥댄겕�릺寃� �빐二쇰뒗 湲곕뒫
                 $rootScope.selectOption = function (useValues, value) {
@@ -231,10 +245,12 @@
 
                 //  沅뚰븳 由ъ뒪�듃
                 $rootScope.mngPermission = {
-                    "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,
@@ -244,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) {
@@ -259,6 +287,32 @@
 
                     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.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 () {
@@ -299,22 +353,31 @@
                     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;
-                                    }
-                                });
-                                $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});
+                                }
+                            });
+                        }
                     }
                 };
 
@@ -458,6 +521,11 @@
                     $("#page-container").trigger("click");
                     $("body").unbind("click");
 
+                    // �씠�뒋 寃��깋 �럹�씠吏��뿉�꽌 踰쀬뼱�궇 寃쎌슦 泥섎━
+                    if ($rootScope.isMainSearch) {
+                        $rootScope.isMainSearch = false;
+                    }
+
                     var $uibModalStack = $injector.get('$uibModalStack');
                     $uibModalStack.dismissAll();
 
@@ -488,7 +556,8 @@
                     $tableProvider.reverse = false;
                     //  �씠�뒋 紐⑸줉->�긽�꽭�솕硫댁뿉�꽌 留덉�留됱쑝濡� �젒洹쇳븳 �씠�뒋 �븘�씠�뵒 - �씪�슦�듃 �깉�븣留덈떎 珥덇린�솕
                     $rootScope.currentDetailIssueId = null;
-
+                    // �궗�슜�옄 �젙蹂대�� 媛��졇�삩�떎.
+                    $rootScope.getMyInfo();
 
                     $log.debug("toState.name : ", toState.name);
                     $log.debug("$rootScope.previousStateName �솗�씤 : ", $rootScope.previousStateName);
@@ -541,4 +610,5 @@
 
                 return ctxPath;
             })());
+
     });

--
Gitblit v1.8.0