@php $disabled = false; // !in_array($offer->status, ['offer_preparing', null]); $document_types = []; // 'offer_mail', 'location', 'technical_description', 'email', 'warranty', 'survey' // 'control' $document_model = 'Offer'; $document_id = $work->offer_id; $hide_column = ['action', 'folder']; $hide_button = $work->status == 'organized' ? ['document_migration'] : ['document_migration', 'document_upload', 'worksheet_create']; $issue_ticket = $work->issue_ticket; $worksheet = []; if($issue_ticket) // ha hibajegy { if($issue_ticket->worksheet_id) $worksheet = App\Models\Worksheet::where('id', $issue_ticket->worksheet_id)->get(); $document_types = ['issue_ticket', 'survey']; $document_model = 'IssueTicket'; $document_id = $issue_ticket->id; $documents = App\Models\Document::where('target_type', 'App\Models\\'.$document_model)->where('target_id', $document_id)->get(); $hide_button = array_filter($hide_button, function($value) { return $value !== 'document_upload'; }); } if($work->task_id) // ha naptárbejegyzés { $documents = new App\Models\Document; $document_types = ['calendar_task']; $document_model = 'Work'; $document_id = $work ? $work->id : null; $documents = $work ? $documents->where('target_type', 'App\Models\\'.$document_model)->where('target_id', $document_id)->get() : null; } @endphp @if(!$issue_ticket && !$work->task_id) @can('show-document-plan') @php array_push($document_types, 'handover_report') @endphp @endcan @can('show-document-location') @php array_push($document_types, 'location') @endphp @endcan @endif @extends('layouts.admin') @section('main-content')
@if($work?->process?->contact_phone || $work?->process?->client?->phone) {{ $phone }} @endif
Dokumentumok
@include('process.tables.documents', [ 'documents' => $documents, 'types' => $document_types, 'model' => $document_model, 'id' => $document_id, 'table_id' => 'dt_offer', 'hide_column' => $hide_column, 'hide_button' => $hide_button, ])Munkalapok / jegyzőkönyvek
@include('process.tables.worksheets', [ 'work' => $work, 'worksheet' => $worksheet, 'table_id' => 'dt_worksheet', 'hide_button' => $hide_button, ])