# 05_employee_management/05_09_admin_menu.md 版:v1.3 実装の状況は `work_order_db_migration.md`(作業書)を見る ## 1. 概要 人事管理メニュー。登録・マスタ管理・書類発行など、頻度の低い管理業務を集約する。 ## 2. 画面構成 - ファイルパス: `employees/admin_menu.html` - 遷移元: 人事メニュー(`employees/menu.html`)の「人事管理」ボックス - ヘッダー: 「← 人事メニューへ」リンク、タイトル「人事管理」、ユーザー名表示 - コンテナ: `.card-grid` によるボックス表示(6ボックス) ## 3. 表示ボックスと遷移先 | ボックス | リンク先(backoffice以降) | 表示に必要な権限 | |---|---|---| | 従事者登録 | employees/register.html | profile_edit_all / permission_assign | | 身分証発行 | employees/id_card.html | employee_id_card_issue | | 従事者マスタ管理 | employees/edit.html | profile_edit_self / profile_edit_branch / profile_edit_all | | 部署マスタ管理 | master/department_edit.html | permission_assign | | 職務マスタ管理 | master/position_edit.html | permission_assign | | 契約マスタ管理 | master/contract_edit.html | permission_assign | - 「従事者登録」の流れ(従事者の登録 → ユーザーの作成 → 初期パスワードの発行 → 通知待ち一覧)は `00_03_login_session.md` 11節に従う。`register.html` は未設置。 - 賞罰、昇進・降格の登録は、`edit.html` の従事者の画面にあるボタン(出来事の登録)で行う。本メニューにボックスは置かない(`00_10_change_history.md` 4.1・8節)。 - `employee_id_card_issue` は権限マスタに登録済み(`06_01` 2.12節)。 ※ 「従事者マスタ管理」は、`edit.html` 内の検索・選択欄で対象の従事者を選ぶ。`edit.html` は `sps_id` なしで開き、検索・選択で対象を選んでから編集する(`sps_id` 付きで直接開く場合は、検索・選択を省く)。 ## 4. 権限制御 - 各ボックスは `window.hasPermission('<必要な権限>')` が `true` の場合のみ描画する。 - 権限がない場合はボックス自体を非表示にする。 - `supreme_access` を持つユーザーはすべてのボックスが表示される。 ## 5. スクリプト構成 ```javascript window.addEventListener('spsSessionReady', function () { const boxes = [ { id: 'box-register', perms: ['profile_edit_all', 'permission_assign'] }, { id: 'box-idcard', perms: ['employee_id_card_issue'] }, { id: 'box-master', perms: ['profile_edit_self', 'profile_edit_branch', 'profile_edit_all'] }, { id: 'box-dept', perms: ['permission_assign'] }, { id: 'box-pos', perms: ['permission_assign'] }, { id: 'box-contract', perms: ['permission_assign'] } ]; 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-27 | 1.1 | Deepseek(5代目) | 権限キー改名(master_access→supreme_access)を反映。「従事者マスタ管理」の説明に、検索・選択欄で対象を選ぶ旨を追記。 | | 2026-10-29 | 1.2 | 全体管理者(14代目) | 従事者登録の流れ(00_03 11節)、出来事の登録の置き場(edit.html 内)、`employee_id_card_issue` の登録状況を追記 | | 2026-10-29 | 1.3 | 全体管理者(14代目) | 権限キーの登録状況の記述を整理 |