# 05_employee_management/05_01_menu.md 版:v1.5 実装の状況は `work_order_db_migration.md`(作業書)を見る ## 1. 概要 人事メニューのトップページ。 アクセス権限に応じてリンクブロックを表示制御する。 ## 2. 画面構成 - ファイルパス: `employees/menu.html` - 遷移元: TOPページ(`index.html`)の「人事・組織」ボックス(ボタン文言:「人事メニューへ」) - ヘッダー: 「← SPS BACK OFFICEへ」リンク、タイトル「人事メニュー」、ユーザー名表示 - コンテナ: `.card-grid` によるボックス表示(7ボックス) ## 3. 表示ボックスと遷移先 | ボックス | リンク先(backoffice以降) | 表示に必要な権限 | |---|---|---| | 従事者一覧 | employees/index.html | profile_view_self / profile_view_branch / profile_view_all | | 担当者一覧 | employees/directory.html | employee_directory_view | | 従事者名簿 | employees/audit_list.html | employee_audit_view | | 人事考課 | employees/evaluation.html | hr_evaluation_manage | | 人事異動履歴 | employees/transfer_history.html | hr_transfer_history_view | | 人事管理 | employees/admin_menu.html | profile_edit_self / profile_edit_branch / profile_edit_all / permission_assign のいずれか | | 変更履歴の確認 | master/history_review.html | change_history_review | - 「人事異動履歴」(`transfer_history.html`)は、変更履歴(`change_history`)と出来事(`employee_events`)を時系列で見る、閲覧専用の画面。別の記録は持たない(`05_08_transfer_history.md`)。 - 「変更履歴の確認」ボックスには、未確認・承認待ちの件数を表示する(`00_10` 8節)。件数を取るAPIの名称は、ツリー承認で確定する。件数が0のときは、件数を出さない。 - 本表の権限のうち、`employee_directory_view`、`employee_audit_view`、`hr_evaluation_manage`、`hr_transfer_history_view`、`change_history_review` は、権限マスタに登録済み(`06_01` 2.12・2.13節)。 ## 4. 権限制御 - 各ボックスは `window.hasPermission('<必要な権限>')` が `true` の場合のみ描画する。 - 権限がない場合はボックス自体を非表示にする(`display: none;` またはDOMから削除)。 - `supreme_access` を持つユーザーはすべてのボックスが表示される(`window.hasPermission()` が判定する。ボックスごとには書かない)。 ## 5. スクリプト構成 ```javascript window.addEventListener('spsSessionReady', function () { const boxes = [ { id: 'box-list', perms: ['profile_view_self', 'profile_view_branch', 'profile_view_all'] }, { id: 'box-directory', perms: ['employee_directory_view'] }, { id: 'box-audit', perms: ['employee_audit_view'] }, { id: 'box-evaluation', perms: ['hr_evaluation_manage'] }, { id: 'box-transfer', perms: ['hr_transfer_history_view'] }, { id: 'box-admin', perms: ['profile_edit_self', 'profile_edit_branch', 'profile_edit_all', 'permission_assign'] }, { id: 'box-history', perms: ['change_history_review'] } ]; boxes.forEach(function (b) { const canView = b.perms.some(function (p) { return window.hasPermission(p); }); const el = document.getElementById(b.id); if (el) { if (canView) { el.style.display = 'block'; } else { el.style.display = 'none'; } } }); }); ``` ## 6. 制約 - localStorage / sessionStorage 使用禁止。 - confirm() / alert() 使用禁止。 ## 7. 改訂履歴 | 日付 | 版 | 担当 | 内容 | |------|----|------|------| | 2026-10-26 | 1.0 | Deepseek(5代目) | 初版作成 | | 2026-10-26 | 1.1 | Deepseek(5代目) | ボックス数を6個に整理。名称を「担当者一覧」「従事者名簿」「人事管理」に変更。人事管理(employees/admin_menu.html)へのリンクを追加。 | | 2026-10-27 | 1.2 | Deepseek(5代目) | 権限キー改名(master_access→supreme_access)を反映。 | | 2026-10-29 | 1.3 | 全体管理者(14代目) | ボックスを7個に変更(「変更履歴の確認」を追加。表示は `change_history_review`)。未確認件数の表示、人事異動履歴との関係(案・未決)、権限キーの登録状況(`permissions.json` v1.6)を追記 | | 2026-10-29 | 1.4 | 全体管理者(14代目) | DB前提の書き直し。権限キーの登録状況の記述を整理 | | 2026-10-29 | 1.5 | 全体管理者(14代目) | 人事異動履歴は、閲覧専用の画面に確定(`05_08` v2.0)。「未決」の注記を削除 |