| | |
| | | removeManager : removeManager, // 전송 대상자 삭제 |
| | | cancel : cancel, // 팝업 창 닫기 |
| | | formSubmit : formSubmit, // 폼 전송 |
| | | formCheck : formCheck // 폼 체크 |
| | | // formCheck : formCheck // 폼 체크 |
| | | }; |
| | | |
| | | |
| | | $scope.vm = { |
| | | form : { |
| | | id : parameter.issueId, // 이슈 번호 |
| | | projects : [{ id : parameter.projectId}], // 프로젝트 |
| | | users : [] // 메일 전송받는 사용자 |
| | | partners : parameter.partners, |
| | | users : [], // 메일 전송받는 사용자 |
| | | issueCompanyVos : [], |
| | | issueIspVos : [], |
| | | issueHostingVos : [] |
| | | // companyFields : parameter.issueCompanyFields, // 업체 이메일 |
| | | // ispFields : parameter.issueIspFields, // ISP 이메일 |
| | | // hostingFields : parameter.issueHostingFields, // 호스팅 이메일 |
| | | }, |
| | | userName : "", |
| | | partnerName : "", |
| | | autoCompletePage : { |
| | | user : { |
| | | page : 0, |
| | | totalPage : 0 |
| | | }, |
| | | partnersMail : { |
| | | page : 0, |
| | | totalPage :0 |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | function formCheck(formInvalid) { |
| | | if (formInvalid) { |
| | | return true; |
| | | } |
| | | |
| | | if ($scope.vm.form.users.length < 1) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | // function formCheck(formInvalid) { |
| | | // if (formInvalid) { |
| | | // return true; |
| | | // } |
| | | // |
| | | // if ($scope.vm.form.users.length < 1) { |
| | | // return true; |
| | | // } |
| | | // |
| | | // return false; |
| | | // } |
| | | |
| | | // 폼 전송 |
| | | function formSubmit() { |
| | | $rootScope.spinner = true; |
| | | |
| | | var content = { |
| | | id : $scope.vm.form.id, |
| | | sendEmails : (function () { |
| | | var sendEmails = []; |
| | | |
| | | angular.forEach($scope.vm.form.users, function (user) { |
| | | sendEmails.push($rootScope.encryption(user.account)); |
| | | angular.forEach($scope.vm.form.projects, function (project) { |
| | | sendEmails.push(project.id); |
| | | }); |
| | | |
| | | return sendEmails; |
| | |
| | | }); |
| | | } |
| | | |
| | | // function formSubmit() { |
| | | // $rootScope.spinner = true; |
| | | // |
| | | // var content = { |
| | | // id : $scope.vm.form.id, |
| | | // companyFieldsEmail : $scope.vm.form.companyFieldsEmail, |
| | | // ispFieldsEmail : $scope.vm.form.ispFieldsEmail, |
| | | // hostingFieldsEmail : $scope.vm.form.hostingFieldsEmail, |
| | | // sendEmails : (function () { |
| | | // var sendEmails = []; |
| | | // |
| | | // angular.forEach($scope.vm.form.projects, function (project) { |
| | | // sendEmails.push(project.id); |
| | | // }); |
| | | // |
| | | // return sendEmails; |
| | | // })() |
| | | // }; |
| | | // |
| | | // Issue.findMailTargetAll($resourceProvider.getContent( |
| | | // content, |
| | | // $resourceProvider.getPageContent(0, 10))).then(function (result) { |
| | | // |
| | | // if (result.data.message.status === "success") { |
| | | // SweetAlert.success($filter("translate")("issue.succeededIssueMail"), $filter("translate")("issue.sentToTheSelectedUser")); // "이슈 메일 발송 완료" |
| | | // $scope.fn.cancel(); |
| | | // } |
| | | // else { |
| | | // SweetAlert.error($filter("translate")("issue.failedIssueMail"), result.data.message.message); // "이슈 메일 발송 실패" |
| | | // } |
| | | // |
| | | // $rootScope.spinner = false; |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | // 사용자 auto complete callback function |
| | | function getUserListCallBack(result) { |
| | | $scope.vm.autoCompletePage.user.totalPage = result.data.page.totalPage; |