OWL ITS + 탐지시스템(인터넷 진흥원)
src/main/webapp/scripts/app/issue/issueAdd.controller.js
@@ -58,7 +58,8 @@
                        attachedFiles : [], //  섬머노트로 파일 업로드를 할 경우 서버에서 pk를 따고 issue id와 연동 작업이 필요하다.
                        startCompleteDateRange : "", //  시작일 ~ 종료일
                        detectingDateRange : "", //  탐지일
                        issueCustomFields : []  //  이슈에서 사용되는 사용자 정의 필드
                        issueCustomFields : [],  //  이슈에서 사용되는 사용자 정의 필드
                        requiredDatas : []  // 사용자 정의 필드 필수 데이터 체크
                    },
                    infiniteAdd : false,    //  연속 생성
                    projectName : "",   //  프로젝트 명 검색
@@ -120,6 +121,18 @@
                    fileTableConfigs : [],   //  파일 업로드 정보 테이블
                };
                // 연관 일감 관련
                $scope.vm.relationIssueTypes =
                    [
                        { id: 0, name: $filter("translate")("issue.relationIssueType1") },
                        { id: 1, name: $filter("translate")("issue.relationIssueType2") },
                        { id: 2, name: $filter("translate")("issue.relationIssueType3") },
                        { id: 3, name: $filter("translate")("issue.relationIssueType4") },
                        { id: 4, name: $filter("translate")("issue.relationIssueType5") },
                        { id: 5, name: $filter("translate")("issue.relationIssueType6") }
                    ];
                $scope.vm.relationIssueType = $scope.vm.relationIssueTypes[0];
                angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector}));
                function getStartProjectListCallback(result){
@@ -132,13 +145,15 @@
                //  프로젝트가 변경되면 담당자 초기화
                $scope.$watch("vm.form.projects", function (newValue, oldValue) {
                    if (angular.isDefined(newValue)) {
                        if (newValue.length < 1) {
                            $scope.vm.form.users = [];
                        } else {
                            //  이슈 유형에 연결된 사용자 정의 필드 가져오기
                            $scope.fn.getIssueTypeCustomFields();
                        }
                        //  이슈 유형에 연결된 사용자 정의 필드 가져오기
                        $scope.fn.getIssueTypeCustomFields();
                    }
                });
@@ -544,6 +559,30 @@
                        startCompleteDateRange : $scope.vm.form.startCompleteDateRange,
                        detectingDateRange : $scope.vm.form.detectingDateRange,
                        requiredDatas : (function () {    //  사용자 정의 필드 필수 데이터 체크
                            var requiredDatas = [];
                            angular.forEach($scope.vm.form.requiredDatas, function (issueCustomField) {
                                var useValues = [];
                                if (angular.isArray(issueCustomField.useValues)) {
                                    angular.forEach(issueCustomField.useValues, function (useValue) {
                                        useValues.push(useValue.value);
                                    });
                                }
                                else {
                                    useValues.push(issueCustomField.useValues);
                                }
                                //  useValues 를 배열로 변환한다.
                                var temp = angular.copy(issueCustomField);
                                temp.useValues = useValues;
                                issueCustomFields.push(temp);
                            });
                            return issueCustomFields;
                        })(),
                        issueCustomFields : (function () {    //  이슈에서 사용되는 사용자 정의 필드
                            var issueCustomFields = [];
@@ -672,6 +711,7 @@
                //  이슈 유형에 연결된 사용자 정의 필드
                function getIssueTypeCustomFields() {
                    $scope.vm.form.issueCustomFields = [];
                    $scope.vm.form.requiredDatas = [];
                    //  이슈 타입 아이디나 프로젝트 아이디가 없으면 통신을 하지 않는다.
                    if (!$rootScope.isDefined($scope.vm.form.issueTypeId) || $scope.vm.form.projects.length < 1) {
                        return;
@@ -686,6 +726,8 @@
                        if (result.data.message.status === "success") {
                            $scope.vm.form.issueCustomFields = [];
                            $scope.vm.form.requiredDatas = [];
                            angular.forEach(result.data.data, function (issueTypeCustomField) {
                                switch (issueTypeCustomField.customFieldVo.customFieldType) {
                                    case "INPUT" :
@@ -713,8 +755,10 @@
                                        });
                                        break;
                                }
                                $scope.vm.form.issueCustomFields.push(issueTypeCustomField);
                                if(issueTypeCustomField.customFieldVo.requiredData === "Y") {
                                    $scope.vm.form.requiredDatas.push(issueTypeCustomField.customFieldVo.requiredData);
                                }
                            });
                        }
                        else {
@@ -797,9 +841,8 @@
                        // 현재 프로젝트 설정
                        if ($rootScope.workProject != null && $rootScope.workProject.id > -1) {
                            $scope.vm.projectName = $rootScope.workProject.name;
                            $scope.fn.projects = [];
                            $scope.fn.projects.push($rootScope.workProject);
                            $scope.fn.getProjectList($scope.vm.projectName, $scope.vm.form.projects, $scope.vm.autoCompletePage.project.page, getStartProjectListCallback);
                            $scope.vm.form.projects = [];
                            $scope.vm.form.projects.push($rootScope.workProject);
                        }
                        // 현재 이슈타입 유형 설정
                        var id = $rootScope.getCurrentIssueTypeId();