From 5d6ea07024b475d94b997ad5972f433cf0b5aae4 Mon Sep 17 00:00:00 2001
From: jhjang <jhjang@maprex.co.kr>
Date: 일, 12 12월 2021 18:13:38 +0900
Subject: [PATCH] - 상단 검색 기능 추가

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

diff --git a/src/main/webapp/scripts/config.js b/src/main/webapp/scripts/config.js
index 8a810db..3bf1da7 100644
--- a/src/main/webapp/scripts/config.js
+++ b/src/main/webapp/scripts/config.js
@@ -52,6 +52,10 @@
                 $rootScope.projects = [];
                 //  �쁽�옱 �궗�슜以묒씤 �봽濡쒖젥�듃
                 $rootScope.workProject = null;
+                //  �쁽�옱 �봽濡쒖젥�듃�뿉 �궗�슜以묒씤 �씠�뒋 紐⑸줉(�쑀�삎)
+                $rootScope.workIssueTypes = [];
+                //  �쁽�옱 �꽑�깮以묒씤 �씠�뒋 紐⑸줉
+                $rootScope.issueTypeMenu = null;
                 //  �씠�뒋 紐⑸줉->�긽�꽭�솕硫댁뿉�꽌 留덉�留됱쑝濡� �젒洹쇳븳 �씠�뒋 �븘�씠�뵒 - �씪�슦�듃 �깉�븣留덈떎 珥덇린�솕
                 $rootScope.currentDetailIssueId = null;
                 //  臾몄쓽�븯湲�
@@ -62,6 +66,9 @@
 
                 //  理쒓퀬愿�由ъ옄 議댁옱 �뿬遺�
                 $rootScope.hasSuperUser = false;
+
+                //  硫붿씤 寃��깋 �뿬遺�
+                $rootScope.isMainSearch = false;
 
                 // ���떆蹂대뱶 �꽑�깮 0:�쟾泥� 1:�봽濡쒖젥�듃
                 $rootScope.dashboard = 0;
@@ -125,6 +132,7 @@
 
                     return true;
                 };
+
 
                 //  �씠�뒋 �깮�꽦, �닔�젙�뿉�꽌 �떎以� �꽑�깮, �떒�씪 �꽑�깮 �샃�뀡�뿉 泥댄겕�릺寃� �빐二쇰뒗 湲곕뒫
                 $rootScope.selectOption = function (useValues, value) {
@@ -231,9 +239,11 @@
 
                 //  沅뚰븳 由ъ뒪�듃
                 $rootScope.mngPermission = {
-                    "USER_PERMISSION_MNG_WORKSPACE" : 4096,
-                    "USER_PERMISSION_MNG_PROJECT" : 2048,
-                    "USER_PERMISSION_MNG_USER" : 1024,
+                    "USER_PERMISSION_MNG_WORKSPACE" : 16384,
+                    "USER_PERMISSION_MNG_PROJECT" : 8192,
+                    "USER_PERMISSION_MNG_ISSUE_PROJECT_ALL" : 4096,
+                    "USER_PERMISSION_MNG_PARTNER" : 2048,
+                    "USER_PERMISSION_MNG_API" : 1024,
                     "USER_PERMISSION_MNG_ISSUE_STATUS" : 512,
                     "USER_PERMISSION_MNG_WORKFLOW" : 256,
                     "USER_PERMISSION_MNG_CUSTOME_FIELD" : 128,
@@ -244,6 +254,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 +281,20 @@
 
                     return false;
                 };
+
+                /*$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 () {
@@ -284,7 +320,7 @@
                         return false;
                     }
 
-                    var permissionVal = $rootScope.mngPermission['USER_PERMISSION_MNG_USER'];
+                    var permissionVal = $rootScope.mngPermission['USER_PERMISSION_MNG_API'];
                     permissionVal += $rootScope.mngPermission['USER_PERMISSION_MNG_NOTICE'];
                     permissionVal += $rootScope.mngPermission['USER_PERMISSION_MNG_FAQ'];
                     permissionVal += $rootScope.mngPermission['USER_PERMISSION_MNG_QNA'];
@@ -299,22 +335,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});
+                                }
+                            });
+                        }
                     }
                 };
 

--
Gitblit v1.8.0