'name', 'label' => '이름', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null], ['field_key' => 'email', 'label' => '이메일', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null], ['field_key' => 'phone', 'label' => '전화번호', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null], ['field_key' => 'department', 'label' => '부서', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'position', 'label' => '직급', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'job_title', 'label' => '직책', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'manager_id', 'label' => '직속 상급자', 'data_type' => 'bigint', 'input_type' => 'select_user', 'option_source' => null], ['field_key' => 'hire_date', 'label' => '입사일', 'data_type' => 'date', 'input_type' => 'date', 'option_source' => null], ['field_key' => 'employment_type', 'label' => '고용형태', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'work_location', 'label' => '근무지', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'work_type', 'label' => '근무형태', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'gender', 'label' => '성별', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'bank_name', 'label' => '은행', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'], ['field_key' => 'bank_account', 'label' => '계좌번호', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null], ['field_key' => 'employee_no', 'label' => '사번', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null], ['field_key' => 'profile_photo', 'label' => '프로필 사진', 'data_type' => 'file', 'input_type' => 'file', 'option_source' => null], ]; // tenant_option_groups (id, name) — select 항목에서 선택할 그룹 $OPTION_GROUPS = [ ['id' => 101, 'group_key' => 'department', 'name' => '부서 그룹'], ['id' => 102, 'group_key' => 'position', 'name' => '직급 그룹'], ['id' => 103, 'group_key' => 'job_title', 'name' => '직책 그룹'], ['id' => 104, 'group_key' => 'employment_type', 'name' => '고용형태 그룹'], ['id' => 105, 'group_key' => 'work_location', 'name' => '근무지 그룹'], ['id' => 106, 'group_key' => 'work_type', 'name' => '근무형태 그룹'], ['id' => 107, 'group_key' => 'gender', 'name' => '성별 그룹'], ['id' => 108, 'group_key' => 'bank_name', 'name' => '은행 그룹'], ]; // tenant_field_settings (샘플: enabled/required/sort/order/group) // key = field_key $SETTINGS = [ 'name' => ['enabled' => 1, 'required' => 1, 'sort_order' => 10, 'option_group_id' => null], 'email' => ['enabled' => 1, 'required' => 1, 'sort_order' => 20, 'option_group_id' => null], 'phone' => ['enabled' => 1, 'required' => 0, 'sort_order' => 30, 'option_group_id' => null], 'department' => ['enabled' => 1, 'required' => 1, 'sort_order' => 40, 'option_group_id' => 101], 'position' => ['enabled' => 1, 'required' => 0, 'sort_order' => 50, 'option_group_id' => 102], 'job_title' => ['enabled' => 0, 'required' => 0, 'sort_order' => 60, 'option_group_id' => 103], 'manager_id' => ['enabled' => 0, 'required' => 0, 'sort_order' => 70, 'option_group_id' => null], 'hire_date' => ['enabled' => 1, 'required' => 0, 'sort_order' => 80, 'option_group_id' => null], 'employment_type' => ['enabled' => 1, 'required' => 0, 'sort_order' => 90, 'option_group_id' => 104], 'work_location' => ['enabled' => 1, 'required' => 0, 'sort_order' => 100, 'option_group_id' => 105], 'work_type' => ['enabled' => 0, 'required' => 0, 'sort_order' => 110, 'option_group_id' => 106], 'gender' => ['enabled' => 0, 'required' => 0, 'sort_order' => 120, 'option_group_id' => 107], 'bank_name' => ['enabled' => 0, 'required' => 0, 'sort_order' => 130, 'option_group_id' => 108], 'bank_account' => ['enabled' => 0, 'required' => 0, 'sort_order' => 140, 'option_group_id' => null], 'employee_no' => ['enabled' => 1, 'required' => 0, 'sort_order' => 150, 'option_group_id' => null], 'profile_photo' => ['enabled' => 0, 'required' => 0, 'sort_order' => 160, 'option_group_id' => null], ]; // helper: 옵션그룹 셀렉트 HTML function render_group_select($field_key, $sel, $groups, $def) { if (! ($def['input_type'] === 'select' && $def['option_source'] === 'tenant_list')) { return '—'; } $html = ''; return $html; } // 기존 render_group_select() 제거하고 ↓로 교체 function group_name_by_id($id, $groups) { foreach ($groups as $g) { if ((string) $g['id'] === (string) $id) { return $g['name']; } } return null; } function render_group_label($field_key, $sel_id, $groups, $def) { // select + tenant_list 타입만 노출, 그 외는 대시 if (! ($def['input_type'] === 'select' && $def['option_source'] === 'tenant_list')) { return '—'; } if (! $sel_id) { return '미지정'; } $name = htmlspecialchars(group_name_by_id($sel_id, $groups) ?: '알 수 없음'); // 필요하면 관리 링크 표시 return ''.$name.'' .' 관리'; } ?>
| 순서 | 필드 | 입력유형 | 옵션 그룹 | 필수 | 사용 | 관리 |
|---|---|---|---|---|---|---|
|
|
= htmlspecialchars($def['label']) ?>
= htmlspecialchars($key) ?> · = htmlspecialchars($def['data_type']) ?>
|
= htmlspecialchars($def['input_type']) ?> | = render_group_label($key, $groupId, $OPTION_GROUPS, $def) ?> |
= $enabled ? '' : 'disabled' ?>>
|
>
|