From 58f1b7535045887e6baa5ae5392d5d6ed28f0d93 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Mon, 27 Oct 2025 14:26:19 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E3=82=A8=E3=82=AF=E3=82=B9=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=95=E3=82=8C=E3=81=9FPDF=E3=81=AE?= =?UTF-8?q?=E3=82=B0=E3=83=AA=E3=83=83=E3=83=89=E7=B7=9A=E3=82=92=E9=9D=9E?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=AB=E3=81=99=E3=82=8B=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- export_pdf.gs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export_pdf.gs b/export_pdf.gs index fa8c6bc..6f04b08 100644 --- a/export_pdf.gs +++ b/export_pdf.gs @@ -27,7 +27,8 @@ function exportSheetAsPdf(spreadsheetId, sheetName, folderId, includeTimestamp) `&left_margin=0.75` + `&right_margin=0.75` + `&printtitle=true` + // スプレッドシートのタイトルをヘッダーに挿入 - `&pagenum=CENTER`; // ページ番号をフッターに挿入 (より汎用的な設定) + `&pagenum=CENTER` + // ページ番号をフッターに挿入 (より汎用的な設定) + `&gridlines=false`; // グリッド線非表示 // 注: ヘッダーの右にエクスポート日時を挿入する、またはヘッダーの中心にワークブックのタイトルを挿入する // 直接的なURLパラメータはありません。`printtitle=true`は通常左上にタイトルを挿入します。 From 6a905fe65c543f4495e513bb6942a241413495e2 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Sun, 2 Nov 2025 11:18:53 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9C=AC=E5=BD=93=E3=81=AB=20Google=20Chat?= =?UTF-8?q?=20=E3=81=AB=E9=80=81=E4=BF=A1=E3=81=97=E3=81=A6=E3=82=88?= =?UTF-8?q?=E3=81=84=E3=81=8B=E7=A2=BA=E8=AA=8D=E3=81=99=E3=82=8B=E3=83=80?= =?UTF-8?q?=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.gs b/main.gs index 99336fc..f081c71 100644 --- a/main.gs +++ b/main.gs @@ -2,7 +2,7 @@ function onOpen() { var ui = SpreadsheetApp.getUi(); var menu = ui.createMenu('出版'); menu.addItem('変更内容を登録', 'showCommitRevision') - menu.addItem('Google Chat に送信', 'mergeMain'); + menu.addItem('Google Chat に送信', 'mergeMainPermission'); menu.addToUi(); } @@ -15,6 +15,16 @@ function showCommitRevision() { SpreadsheetApp.getUi().showSidebar(html); } +// 本当に Google Chat に送信してよいか確認するダイアログ +function mergeMainPermission() { + var ui = SpreadsheetApp.getUi(); + var response = ui.alert("Google Chat に送信します", ui.ButtonSet.OK_CANCEL); + + if (response == "OK") { + mergeMain(); + } +} + // 変更内容の保存 function saveCommitRevision(changes) { const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet(); From ab37037d72e95818c96d85c238c4d54dedf36702 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Sun, 2 Nov 2025 11:58:30 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E7=B7=A8=E9=9B=86=E8=80=85=E3=81=AE?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=83=AB=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E9=87=8D=E8=A4=87=E3=81=AA=E3=81=97=E3=81=A7=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E3=81=99=E3=82=8B=E3=83=97=E3=83=AD=E3=82=B0=E3=83=A9?= =?UTF-8?q?=E3=83=A0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 11 +++++++++++ notice.gs | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/main.gs b/main.gs index f081c71..633b816 100644 --- a/main.gs +++ b/main.gs @@ -85,6 +85,12 @@ function mergeMain() { changes.push(changelogs[i][2]) } + // 編集者のメールアドレスを取得 + var editorEmail = [] + for (let i = 0; i < changelogs.length; i++) { + editorEmail.push(changelogs[i][1]) + } + // バージョン表記の更新 // '.config'!B2: バージョン情報が記載されたせる const configSheet = ss.getSheetByName(".config") @@ -109,6 +115,11 @@ function mergeMain() { // Google Chat で送信 const message_content = { "sheetName": sheetName, + "publisher": { + "name": "publisherName", + "email": "publisherEmail" + }, + "editor": Array.from(new Set(editorEmail)), "changes": changes, "download": { "color": color_data.sharingUrl, diff --git a/notice.gs b/notice.gs index 242be5b..822145c 100644 --- a/notice.gs +++ b/notice.gs @@ -13,12 +13,16 @@ function sendGooglechat(messageContents, webhookUrl) { // 送信するテキストメッセージ const textMessage = "「" + messageContents.sheetName + "」が更新されました。"; + + // 貢献者の情報 + const contributor = messageContents.publisher.name + "と他" + messageContents.editor + "人の編集者" // 送信するカードのJSON const cardMessage = { "header": { "title": messageContents.sheetName, + "subtitle": contributor }, "sections": [ { From 8d632a79cef92184a85ff51a021f0c99f24fbbf5 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Sun, 2 Nov 2025 12:47:32 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E5=87=BA=E7=89=88=E8=80=85=E3=81=AE?= =?UTF-8?q?=E5=90=8D=E5=89=8D=E3=81=A8=E3=83=A1=E3=83=BC=E3=83=AB=E3=82=A2?= =?UTF-8?q?=E3=83=89=E3=83=AC=E3=82=B9=E3=82=92=E3=82=B7=E3=83=A5=E3=83=88?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=99=E3=82=8B=E3=83=97=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=83=A9=E3=83=A0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.gs b/main.gs index 633b816..430d885 100644 --- a/main.gs +++ b/main.gs @@ -91,6 +91,12 @@ function mergeMain() { editorEmail.push(changelogs[i][1]) } + // 出版者の情報を取得 + const publisherEmail = Session.getActiveUser().getEmail(); + const editorSheet = ss.getSheetByName(".editor"); + const editors = editorSheet.getRange(2, 1, editorSheet.getLastRow() - 1, 2).getValues(); + const publisherName = editors.find(row => row[0] === publisherEmail)[1]; + // バージョン表記の更新 // '.config'!B2: バージョン情報が記載されたせる const configSheet = ss.getSheetByName(".config") @@ -116,8 +122,8 @@ function mergeMain() { const message_content = { "sheetName": sheetName, "publisher": { - "name": "publisherName", - "email": "publisherEmail" + "name": publisherName, + "email": publisherEmail }, "editor": Array.from(new Set(editorEmail)), "changes": changes, From ae2988fdf7560e19b971a9ef94d39fe528e59eea Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Sun, 2 Nov 2025 13:14:24 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B2=A2=E7=8C=AE=E8=80=85=E3=81=AE?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=82=92=20Google=20Chat=20=E3=81=AE?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AB=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notice.gs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/notice.gs b/notice.gs index 822145c..da71820 100644 --- a/notice.gs +++ b/notice.gs @@ -15,14 +15,23 @@ function sendGooglechat(messageContents, webhookUrl) { const textMessage = "「" + messageContents.sheetName + "」が更新されました。"; // 貢献者の情報 - const contributor = messageContents.publisher.name + "と他" + messageContents.editor + "人の編集者" + let contributor = messageContents.editor; + contributor.push(messageContents.publisher.email); + contributor = Array.from(new Set(contributor)); + + var contributorMessage; + if (contributor.length - 1 > 0){ + contributorMessage = messageContents.publisher.name + " と他" + Number(contributor.length - 1) + "人の編集者"; + } else { + contributorMessage = messageContents.publisher.name + "によって出版"; + } // 送信するカードのJSON const cardMessage = { "header": { "title": messageContents.sheetName, - "subtitle": contributor + "subtitle": contributorMessage }, "sections": [ {