@php /*-------------------------------------------- 파일업로드정보 입력/뷰 template --------------------------------------------*/ // 다중호출 시 javascript binding의 중복을 방지하기 위해 랜덤키를 생성 $element_key = 'key-'.Str::random(16); $fileController = new App\Http\Controllers\Process\FileController(); // 카테고리 리스트 (Default) $list_category = $fileController->getCategoryList(isLogin('agent') ? 'agent' : (isLogin('staff') ? 'staff' : ''), [ 'code_uhaktype' => isset($code_uhaktype) ? $code_uhaktype : '', 'code_uhakcourse' => isset($code_uhakcourse) ? $code_uhakcourse : '', ]); $process = isset($process_id) && $process_id ? App\Model\Process::find($process_id) : null; $files = []; if (isset($file) && $process) { foreach ($file as $f) { $file_list_category = $fileController->getCategoryList($f->created_member_guard, ['code_uhaktype' => $process->code_uhaktype, 'code_uhakcourse' => $process->code_uhakcourse]); if (!array_key_exists($f->category, $file_list_category)) { $category = ConfigCode::getCode('PROCESS_FILE_CATEGORY', $f->category); if ($category) { $file_list_category[$f->category] = $category->name; } else { $file_list_category[$f->category] = $f->category; } } array_push($files, [ 'file_id' => $f->process_file_id, 'download' => URL::route('file.upload.download', ['process', $f->process_file_id]), 'preview' => URL::route('file.upload.view', ['process', $f->process_file_id]), 'ext' => $f->ext, 'name' => $f->name, 'size' => $f->size, 'category' => $f->category, 'register' => $f->created_member_guard === 'agent' ? Lang::get('process.word.agency') : 'ed:m', 'date' => $f->created_date ? $f->created_date->format('U') : null, 'list_category' => $file_list_category, 'category_enabled' => (isLogin('staff') || ($f->created_member_guard === 'agent' && isLogin('agent'))) ? true : false, 'delete_enabled' => (isLogin('staff') || ($f->created_member_guard === 'agent' && isLogin('agent'))) ? true : false, // 에이전시일 경우 삭제 권한 제한 'path' => $f->path ]); } } @endphp
{{-- process_file_enabled : process 등록 중 file관련 항목들에 대해 저장 활성화 flag --}}
@include('template.form.input-fileupload', [ 'url' => isset($process_id) ? URL::route('process.file.save', $process_id) : null, 'multiple' => true, 'file' => $files, 'invisible' => isset($invisible) ? $invisible : [], 'list_category' => $list_category, ])