diff --git a/document/①仕様書_園児別出欠簿入力_20250408.xlsx b/document/①仕様書_園児別出欠簿入力_20250408.xlsx new file mode 100644 index 0000000..7c9fcfb Binary files /dev/null and b/document/①仕様書_園児別出欠簿入力_20250408.xlsx differ diff --git a/src/園児別出欠簿入力/clock-btn-desktop-mobile.js b/src/園児別出欠簿入力/detail-page-desktop-mobile.js similarity index 100% rename from src/園児別出欠簿入力/clock-btn-desktop-mobile.js rename to src/園児別出欠簿入力/detail-page-desktop-mobile.js diff --git a/src/園児別出欠簿入力/clock-btn-desktop.js b/src/園児別出欠簿入力/detail-page-desktop.js similarity index 75% rename from src/園児別出欠簿入力/clock-btn-desktop.js rename to src/園児別出欠簿入力/detail-page-desktop.js index 40069fc..6cdd9d5 100644 --- a/src/園児別出欠簿入力/clock-btn-desktop.js +++ b/src/園児別出欠簿入力/detail-page-desktop.js @@ -4,6 +4,7 @@ // ------------------- 詳細画面表示時の処理 ------------------- kintone.events.on('app.record.detail.show', function (event) { + // 「登園/帰園」ボタン const area = kintone.app.record.getSpaceElement('header-clocking-btn-area'); const clockIn = createBtn('clock-in', '登園', dateToFieldInDetail('登園時刻')); @@ -12,9 +13,19 @@ area.appendChild(clockOut); hideSpaceField(['clock-in-btn-area', 'clock-out-btn-area']); + + // 「伝達事項」 + if (!isBaby(event.record['学年'].value)) { + kintone.app.record.setFieldShown('伝達事項', false); + } + return event; }); + function isBaby(grade) { + return grade === "0歳児" || grade === "1歳児"; + } + function dateToFieldInDetail(fieldCode) { return async function (e) { await new KintoneRestAPIClient().record.updateRecord({ @@ -32,16 +43,28 @@ // ------------------- 印刷画面表示時の処理 ------------------- kintone.events.on('app.record.print.show', (event) => { + // 「登園/帰園」ボタン hideSpaceField(['clock-in-btn-area', 'clock-out-btn-area']); + + // 「伝達事項」 + if (!isBaby(event.record['学年'].value)) { + kintone.app.record.setFieldShown('伝達事項', false); + } return event; }); // ------------------- 編集画面表示時の処理 ------------------- kintone.events.on(['app.record.create.show', 'app.record.edit.show'], function (event) { + // 「登園/帰園」ボタン const clockIn = createBtn('clock-in', '登園', dateToFieldInEdit('登園時刻')); kintone.app.record.getSpaceElement('clock-in-btn-area').appendChild(clockIn); const clockOut = createBtn('clock-out', '帰園', dateToFieldInEdit('帰園時刻')); kintone.app.record.getSpaceElement('clock-out-btn-area').appendChild(clockOut); + + // 「伝達事項」 + if (!isBaby(event.record['学年'].value)) { + kintone.app.record.setFieldShown('伝達事項', false); + } return event; });