diff --git a/Code.gs b/Code.gs
new file mode 100644
index 00000000..36f61b6b
--- /dev/null
+++ b/Code.gs
@@ -0,0 +1,123 @@
+// 양식에 대한 고정값
+let gAuthKey = "GbYfCPydIC5fKP5fmx5wz8gXeEOXpzWWd0UJ";
+let gFormNo = "152521"; //문자열로
+let gCallbackErpResultUrl = encodeURIComponent("callbackerpreturnurl?arg1={1}&arg2={2}&arg3={3}&arg4={4}");
+let gCallbackErpEventUrl = encodeURIComponent("callbackerpeventurl?arg1={1}&arg2={2}&arg3={3}&arg4={4}");
+
+// 문서마다 입력 받을 값
+let gErpUserID = "접속한 사용자의 Email주소 사용";
+let gDocSubject = "화면에서 입력받으세요";
+let gErpDocKey = "sheet고유의 ID를 자동으로 사용";
+let gBodyHtml = "눈에 보고 있는 Sheet 문서 자체를 자동으로 사용";
+
+// sheet
+let ui = SpreadsheetApp.getUi();
+let doc = SpreadsheetApp.getActiveSpreadsheet();
+let scriptPrp = PropertiesService.getScriptProperties()
+
+const onOpen = () => {
+ var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
+ spreadsheet.getRange('A1').setValue(getSpreadsheetName());
+
+ ui.createMenu("지오유")
+ .addItem("본 문서를 전자결재로 상신", "eSign")
+ .addItem("본 문서를 게시방에 게시", "eSign1")
+ .addItem("본 문서를 프로젝트 WBS에 게시", "eSign2")
+ .addSeparator()
+ .addSubMenu(
+ ui
+ .createMenu("바로가기")
+ .addItem("그룹웨어로 이동", "redirectToZioYou")
+ )
+ .addToUi();
+
+}
+
+const include = (filename) => {
+ return HtmlService.createHtmlOutputFromFile(filename).getContent();
+}
+
+const redirectToZioYou = () => {
+ let url = "http://login.zioyou.com";
+ let html = "";
+ let userInterface = HtmlService.createHtmlOutput(html).setHeight(50).setWidth(200);
+ ui.showModalDialog(userInterface, '로딩 중입니다.');
+}
+const redirectToWorkFlow = (url) => {
+ let html = "";
+ let userInterface = HtmlService.createHtmlOutput(html).setHeight(50).setWidth(200);
+ ui.showModalDialog(userInterface, '로딩 중입니다.');
+}
+
+const eSign = () => {
+ gErpUserID = fGetUserInfo().driveUser.emailAddress;
+ gBodyHtml = fGetPubUrl();
+ gErpDocKey = doc.getId();
+
+ scriptPrp.setProperty('gErpUserID', gErpUserID);
+ scriptPrp.setProperty('gBodyHtml', gBodyHtml);
+ scriptPrp.setProperty('gErpDocKey', gErpDocKey);
+
+ let template = HtmlService.createTemplateFromFile('form.html');
+ template.subj = doc.getName(); // HTML 파일에 값 전달
+ template.userid = fGetUserInfo().driveUser.emailAddress; //가능
+ template.userid = Session.getActiveUser().getEmail(); //가능
+ template.bodyhtml = gBodyHtml;
+ let output = template.evaluate();
+ output.setWidth(1400);
+ output.setHeight(600);
+ ui.showModalDialog(output, '전자결재 상신하기');
+}
+
+const processForm = (formObject) => {
+ callRestAPI(formObject);
+}
+
+const fGetPubUrl = () => {
+ var fileId = doc.getId();
+ //Drive : 좌메뉴->편집기->서비스->추가->Drive API
+ Drive.Revisions.update({published: true, publishedOutsideDomain: true, publishAuto: true}, fileId, 1);
+ return "https://docs.google.com/spreadsheet/pub?key=" + fileId;
+}
+
+function fGetUserInfo() {
+ var about = Drive.About.get();
+ var user = {
+ name: about.name,
+ permissionId: about.permissionId,
+ driveUser: about.user
+ };
+ return user;
+}
+
+const callRestAPI = (formObject) => {
+ const url = 'https://dev.zioyou.com/mashup/workflow.create.document';
+ const formData = {
+ "argErpUserID": scriptPrp.getProperty('gErpUserID'),
+ "argFormNo": gFormNo,
+ "argErpDocKey": scriptPrp.getProperty('gErpDocKey'),
+ "argCallbackErpEventUrl": gCallbackErpEventUrl,
+ "argDocSubject": formObject.txtSubject,
+ "argBodyHtml": encodeURIComponent(scriptPrp.getProperty('gBodyHtml')),
+ "argCallbackErpResultUrl": gCallbackErpResultUrl
+ };
+ const headers = {
+ "AuthKey": gAuthKey
+ };
+ const options = {
+ 'method' : 'post',
+ 'contentType': 'application/x-www-form-urlencoded', //application/json
+ 'headers': headers,
+ 'payload': formData //JSON.stringify(formData)
+ };
+ //ui.alert(JSON.stringify(formData));
+ let response = UrlFetchApp.fetch(url, options);
+ let data = JSON.parse(response.getContentText());
+ redirectToWorkFlow(data.result);
+}
+
+function getSpreadsheetName() {
+ var ss = SpreadsheetApp.getActiveSpreadsheet();
+ var name = ss.getName();
+ return name;
+}
diff --git a/README.md b/README.md
deleted file mode 100644
index a1c16095..00000000
--- a/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# 지오유 홈페이지
-http://www.zioyou.com
-
-# ziogle
-Google Workspace Plus
-
-# 참조
-## 구글 API 사용법, 키발급, oAuth인증 사용방법
-https://gomcine.tistory.com/entry/%EA%B5%AC%EA%B8%80-API-%EC%82%AC%EC%9A%A9%EB%B2%95-%ED%82%A4-%EB%B0%9C%EA%B8%89-oauth-%EC%9D%B8%EC%A6%9D-%EB%B0%A9%EB%B2%95-%EC%A0%95%EB%A6%AC
-
-## 부가정보
-
diff --git a/index.html b/index.html
deleted file mode 100644
index 54de93b0..00000000
--- a/index.html
+++ /dev/null
@@ -1,30 +0,0 @@
-function myFunction() {
-
-}
-
-function onOpen() {
- var ui = SpreadsheetApp.getUi();
- // Or DocumentApp or FormApp.
- ui.createMenu('지오유')
- .addItem('본 문서를 전자결재로 상신', 'menuItem1')
- .addSeparator()
- .addSubMenu(ui.createMenu('바로가기')
- .addItem('그룹웨어로 이동', 'menuItem2'))
- .addToUi();
-}
-
-function menuItem1() {
- SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
- .alert('You clicked the first menu item!');
-}
-
-function menuItem2() {
- SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
- .alert('You clicked the second menu item!');
- myFunction();
-}
-
-function OpenZioYou(){
- var htmlOutput = HtmlService.createHtmlOutputFromFile('openUrl').setHeight(100);
- SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Opening ZioYou');
-}
diff --git a/note.txt b/note.txt
deleted file mode 100644
index 20d45345..00000000
--- a/note.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-0. PR(Pull Request) 검증
- 0-1. 학생별 검증
- 0-2. 포인트 발생(1,000 포인트)
- 0-3. Merge학생 1명 선발 (5,000 포인트)
-1. console.cloud.google.com
- - api 소개
- - 구글 API 사용법, 키발급, oAuth인증 사용방법
- https://gomcine.tistory.com/entry/%EA%B5%AC%EA%B8%80-API-%EC%82%AC%EC%9A%A9%EB%B2%95-%ED%82%A4-%EB%B0%9C%EA%B8%89-oauth-%EC%9D%B8%EC%A6%9D-%EB%B0%A9%EB%B2%95-%EC%A0%95%EB%A6%AC
-
-2. ziogle 프로젝트
- - 소개
- https://academy.zioyou.com/home2/contents?cateno=74
- - ojt1
- - ojt2
-
-3. 관련기술 학습
- - 웹서버 설치
- https://academy.zioyou.com/home2/single?cateno=63&atcno=2025
diff --git a/ojt1/index.html b/ojt1/index.html
deleted file mode 100644
index 41b168c6..00000000
--- a/ojt1/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-