File manager - Edit - /var/www/html/portal/resources/views/admin/indicadoresTi/form.blade.php
Back
@php $isEdicao = isset($chamadoForm->id) && $chamadoForm->id; $isConcluido = $isEdicao && $chamadoForm->status === 'atendido'; $isNovo = !$isEdicao; @endphp <div class="chamado-resumo-header p-3 bg-light rounded border cursor-pointer" role="button" style="cursor: pointer;" aria-expanded="{{ $isNovo ? 'false' : 'true' }}"> <div class="d-flex align-items-center justify-content-between"> <div> <strong> @if ($isNovo) <i class="fa-solid fa-plus-circle me-2 text-primary"></i> {{ __('Novo Chamado') }} @else <i class="fa-solid fa-ticket me-2 text-primary"></i> {{ $chamadoForm->numero ?? '#' . $chamadoForm->id }} <span class="badge bg-{{ $chamadoForm->status === 'atendido' ? 'success' : ($chamadoForm->status === 'em_andamento' ? 'info' : 'warning') }} ms-2"> {{ __(\App\Models\IndicadoresTi\Chamado::STATUS[$chamadoForm->status] ?? $chamadoForm->status) }} </span> @endif </strong> @if (!$isNovo) <small class="text-muted ms-2"> {{ $chamadoForm->cliente->nome ?? __('Sem cliente') }} | {{ $chamadoForm->setor->nome ?? __('Sem setor') }} </small> @endif </div> <div class="d-flex align-items-center gap-2"> <small class="text-muted chamado-resumo-hint d-none d-sm-inline"> {{ $isNovo ? 'Clique para abrir formulário' : 'Clique para expandir/recolher' }} </small> <i class="fa-solid fa-chevron-down chamado-resumo-chevron transition-transform"></i> </div> </div> </div> <div class="chamado-form-wrapper px-3 pt-4" data-aberto="{{ $isNovo ? 'false' : 'true' }}" style="max-height: {{ $isNovo ? '0' : 'none' }}; opacity: {{ $isNovo ? '0' : '1' }}; overflow: hidden; transition: max-height 0.4s ease, opacity 0.3s ease;"> <form action="{{ $action }}" method="POST" class="chamado-form" novalidate> @csrf @if ($method !== 'POST') @method($method) @endif @foreach ($filterParams ?? [] as $key => $value) @if ($value) <input type="hidden" name="{{ $key }}" value="{{ $value }}"> @endif @endforeach @if ($isConcluido) <div class="alert alert-warning d-flex align-items-center gap-2 mb-3" role="alert"> <i class="fa-solid fa-lock"></i> {{ __('Este chamado está finalizado. Marque "Reabrir chamado" para editar.') }} </div> @endif <div class="mb-4"> <div class="fw-semibold text-uppercase small text-secondary border-bottom pb-2 mb-3"> {{ __('IDENTIFICAÇÃO') }}</div> <div class="row g-2"> <div class="col-md-6"> <label class="form-label" for="canal-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Canal') }}</label> @if ($isConcluido) <input type="hidden" name="canal" value="{{ $chamadoForm->canal }}"> @endif <select class="form-select" name="{{ $isConcluido ? '_canal_readonly' : 'canal' }}" id="canal-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : '' }} required> @foreach (\App\Models\IndicadoresTi\Chamado::CANAL as $valor => $label) <option value="{{ $valor }}" @selected(old('canal', $chamadoForm->canal) === $valor)> {{ __($label) }} </option> @endforeach </select> </div> <div class="col-md-6"> <label class="form-label" for="solicitante-{{ $chamadoForm->id ?? 'novo' }}"> {{ __('Solicitante') }} <span class="text-danger">*</span> </label> @if ($isConcluido) <input type="hidden" name="solicitante_id" value="{{ $chamadoForm->user_id ?? $chamadoForm->cliente_id }}"> <input type="hidden" name="solicitante_tipo" value="{{ $chamadoForm->user_id ? 'usuario' : 'cliente' }}"> @endif <div class="input-group"> <div class="position-relative flex-grow-1"> <input type="text" class="form-control js-cliente-search" id="solicitante-{{ $chamadoForm->id ?? 'novo' }}" name="solicitante_nome" placeholder="Digite para buscar cliente ou usuário..." autocomplete="off" {{ $isConcluido ? 'disabled' : '' }} value="{{ old( 'solicitante_nome', $chamadoForm->user_id ? ($chamadoForm->solicitante->matriculation ? $chamadoForm->solicitante->name . ' — ' . $chamadoForm->solicitante->matriculation : $chamadoForm->solicitante->name) : ($chamadoForm->cliente ? $chamadoForm->cliente->nome . ($chamadoForm->cliente->cpf ? ' — ' . $chamadoForm->cliente->cpf : ($chamadoForm->cliente->matricula ? ' — Mat. ' . $chamadoForm->cliente->matricula : '')) : ''), ) }}"> <input type="hidden" name="solicitante_id" class="js-solicitante-id" value="{{ old('solicitante_id', $chamadoForm->user_id ?? $chamadoForm->cliente_id) }}"> <input type="hidden" name="solicitante_tipo" class="js-solicitante-tipo" value="{{ old('solicitante_tipo', $chamadoForm->user_id ? 'usuario' : 'cliente') }}"> </div> @if (!$isConcluido) <button type="button" class="btn btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#modal-novo-cliente" title="Cadastrar novo cliente"> <i class="fa-solid fa-plus"></i> </button> <button type="button" class="btn btn-outline-danger js-limpar-cliente" style="display: none;"> <i class="fa-solid fa-xmark"></i> </button> @endif </div> <div class="js-cliente-info mt-1" style="display: none;"> <small class="text-muted"> <span class="js-cliente-detalhes"></span> </small> </div> </div> </div> </div> <div class="mb-4"> <div class="fw-semibold text-uppercase small text-secondary border-bottom pb-2 mb-3"> {{ __('CLASSIFICAÇÃO') }}</div> <div class="row g-2"> <div class="col-md-4"> <label class="form-label" for="setor-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Setor') }} <span class="text-danger">*</span></label> @if ($isConcluido) <input type="hidden" name="setor_id" value="{{ $chamadoForm->setor_id }}"> @endif <select class="form-select js-setor-select" name="{{ $isConcluido ? '_setor_readonly' : 'setor_id' }}" id="setor-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : 'required' }}> <option value="">{{ __('Selecione') }}</option> @foreach ($setores as $setor) <option value="{{ $setor->id }}" @selected((int) old('setor_id', $chamadoForm->setor_id) === $setor->id)> {{ $setor->nome }} </option> @endforeach </select> </div> <div class="col-md-4"> <label class="form-label" for="assunto-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Assunto') }} <span class="text-danger">*</span></label> @if ($isConcluido) <input type="hidden" name="assunto_id" value="{{ $chamadoForm->assunto_id }}"> @endif <select class="form-select js-assunto-select" name="{{ $isConcluido ? '_assunto_readonly' : 'assunto_id' }}" id="assunto-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : 'required' }}> <option value="">{{ __('Selecione') }}</option> @foreach ($assuntosForm as $assunto) <option value="{{ $assunto->id }}" @selected((int) old('assunto_id', $chamadoForm->assunto_id) === $assunto->id)> {{ $assunto->nome }} </option> @endforeach </select> </div> <div class="col-md-4"> <label class="form-label" for="subassunto-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Subassunto') }} <span class="text-danger">*</span></label> @if ($isConcluido) <input type="hidden" name="subassunto_id" value="{{ $chamadoForm->subassunto_id }}"> @endif <select class="form-select js-subassunto-select" name="{{ $isConcluido ? '_subassunto_readonly' : 'subassunto_id' }}" id="subassunto-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : 'required' }}> <option value="">{{ __('Selecione') }}</option> @foreach ($subassuntosForm as $subassunto) <option value="{{ $subassunto->id }}" @selected((int) old('subassunto_id', $chamadoForm->subassunto_id) === $subassunto->id)> {{ $subassunto->nome }} </option> @endforeach </select> </div> <div class="col-md-4"> <label class="form-label" for="tipo-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Tipo') }} <span class="text-danger">*</span></label> @if ($isConcluido) <input type="hidden" name="tipo" value="{{ $chamadoForm->tipo }}"> @endif <select class="form-select" name="{{ $isConcluido ? '_tipo_readonly' : 'tipo' }}" id="tipo-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : 'required' }}> @foreach (\App\Models\IndicadoresTi\Chamado::TIPO as $valor => $label) <option value="{{ $valor }}" @selected(old('tipo', $chamadoForm->tipo) === $valor)> {{ __($label) }} </option> @endforeach </select> </div> <div class="col-md-4"> <label class="form-label" for="prioridade-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Prioridade') }} <span class="text-danger">*</span></label> @if ($isConcluido) <input type="hidden" name="prioridade" value="{{ $chamadoForm->prioridade }}"> @endif <select class="form-select" name="{{ $isConcluido ? '_prioridade_readonly' : 'prioridade' }}" id="prioridade-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : 'required' }}> @foreach (\App\Models\IndicadoresTi\Chamado::PRIORIDADE as $valor => $label) <option value="{{ $valor }}" @selected(old('prioridade', $chamadoForm->prioridade) === $valor)> {{ __($label) }} </option> @endforeach </select> </div> <div class="col-md-4"> <label class="form-label" for="status-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Status') }} <span class="text-danger">*</span></label> @if ($isConcluido) <input type="hidden" name="status" value="{{ $chamadoForm->status }}"> @endif <select class="form-select" name="{{ $isConcluido ? '_status_readonly' : 'status' }}" id="status-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : 'required' }}> @foreach (\App\Models\IndicadoresTi\Chamado::STATUS as $valor => $label) <option value="{{ $valor }}" @selected(old('status', $chamadoForm->status) === $valor)> {{ __($label) }} </option> @endforeach </select> </div> </div> </div> <div class="mb-4"> <div class="fw-semibold text-uppercase small text-secondary border-bottom pb-2 mb-3">{{ __('DESCRIÇÃO') }} </div> <div> <label class="form-label visually-hidden" for="descricao-{{ $chamadoForm->id ?? 'novo' }}">{{ __('Descrição') }}</label> <textarea class="form-control" name="descricao" id="descricao-{{ $chamadoForm->id ?? 'novo' }}" rows="4" {{ $isConcluido ? 'readonly' : '' }} placeholder="{{ __('Descreva o chamado (opcional)') }}">{{ old('descricao', $chamadoForm->descricao) }}</textarea> </div> </div> <div class="mb-4"> <div class="fw-semibold text-uppercase small text-secondary border-bottom pb-2 mb-3"> {{ __('ATENDIMENTO') }}</div> <div class="row g-2"> <div class="col-md-3"> <label class="form-label">{{ __('Responsável') }}</label> <input type="text" class="form-control" value="{{ $isEdicao ? $chamadoForm->atendente->name ?? '—' : auth()->user()->name ?? '' }}" readonly aria-readonly="true"> </div> <div class="col-md-3"> <label class="form-label">{{ __('Abertura') }}</label> <input type="text" class="form-control" value="{{ optional($chamadoForm->data_abertura)->format('d/m/Y H:i') }}" readonly aria-readonly="true"> </div> <div class="col-md-3"> <label class="form-label">{{ __('Fechamento') }}</label> <input type="text" class="form-control" value="{{ optional($chamadoForm->data_fechamento)->format('d/m/Y H:i') ?? '—' }}" readonly aria-readonly="true"> </div> <div class="col-md-3"> <label class="form-label">{{ __('Tempo de Atendimento') }}</label> @if ($isEdicao && $chamadoForm->isEmAndamento() && $chamadoForm->data_abertura) <div class="input-group"> <span class="form-control tempo-em-andamento" data-inicio="{{ ($chamadoForm->data_reabertura ?? $chamadoForm->data_abertura)->toIsoString() }}" data-acumulado="{{ $chamadoForm->tempo_acumulado ?? 0 }}"> {{ $chamadoForm->getTempoAtendimentoFormatado() }} </span> <span class="input-group-text bg-warning text-dark" title="{{ __('Em andamento') }}"> <i class="fa-solid fa-spinner fa-spin"></i> </span> </div> @elseif ($isEdicao && $chamadoForm->data_fechamento) <input type="text" class="form-control" value="{{ $chamadoForm->getTempoAtendimentoFormatado() }}" readonly> @else <input type="text" class="form-control" value="—" readonly> @endif </div> <div class="col-12"> <label class="form-label" for="unidade-select-{{ $chamadoForm->id ?? 'novo' }}"> {{ __('Unidade Organizacional') }} <span class="text-danger">*</span> </label> @if ($unidadesDoUsuario->isEmpty()) <input type="text" class="form-control" value="{{ __('Nenhuma unidade vinculada ao seu perfil.') }}" disabled readonly> <input type="hidden" name="unidade_organizacional_id" value=""> @else @if ($isConcluido) <input type="hidden" name="unidade_organizacional_id" value="{{ $chamadoForm->unidade_organizacional_id }}"> @endif @php $unidadeDefault = old( 'unidade_organizacional_id', $chamadoForm->unidade_organizacional_id ?? ($unidadesDoUsuario->count() === 1 ? $unidadesDoUsuario->first()->id : null), ); @endphp <select class="form-select" name="{{ $isConcluido ? '_unidade_readonly' : 'unidade_organizacional_id' }}" id="unidade-select-{{ $chamadoForm->id ?? 'novo' }}" {{ $isConcluido ? 'disabled' : '' }}> <option value="">{{ __('Selecione a unidade...') }}</option> @foreach ($unidadesDoUsuario as $unidade) <option value="{{ $unidade->id }}" @selected($unidadeDefault == $unidade->id)> {{ $unidade->abbreviation }} — {{ $unidade->name }} </option> @endforeach </select> @endif <small class="text-muted">{{ __('Opcional — unidade que originou o chamado.') }}</small> </div> </div> </div> @if ($isConcluido) <div class="form-check mb-3"> <input class="form-check-input" type="checkbox" value="1" id="reabrir-{{ $chamadoForm->id }}" name="reabrir"> <label class="form-check-label" for="reabrir-{{ $chamadoForm->id }}"> {{ __('Reabrir chamado para edição') }} </label> </div> @endif <div class="d-flex gap-2 flex-wrap align-items-center mb-5"> <button class="btn btn-outline-primary" type="submit"> <i class="fa-solid fa-floppy-disk me-1"></i>{{ __('Salvar') }} </button> @if ($isEdicao && !$isConcluido) <button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modal-concluir-{{ $chamadoForm->id }}"> <i class="fa-solid fa-check me-1"></i>{{ __('Concluir Chamado') }} </button> <a href="{{ route('admin.indicadoresTi.fecharAba', $chamadoForm->id) }}" class="btn btn-outline-secondary ms-auto"> <i class="fa-solid fa-xmark me-1"></i>{{ __('Fechar') }} </a> @endif @if ($isEdicao && $isConcluido) <a href="{{ route('admin.indicadoresTi.fecharAba', $chamadoForm->id) }}" class="btn btn-outline-secondary ms-auto"> <i class="fa-solid fa-xmark me-1"></i>{{ __('Fechar') }} </a> @endif </div> </form> @if ($isEdicao) @php $userId = auth()->id(); $isDiretorTi = auth()->user()->permissoes->pluck('permissao')->contains('DIRETOR_TI'); $isAtendente = $chamadoForm->atendente_id === $userId; $isParticipante = $chamadoForm->isParticipante($userId); @endphp <div class="mb-4"> <div class="fw-semibold text-uppercase small text-secondary border-bottom pb-2 mb-3 d-flex justify-content-between align-items-center"> <span>{{ __('PARTICIPANTES') }}</span> @if (!$isConcluido && !$isParticipante) <form action="{{ route('admin.indicadoresTi.participantes.store', $chamadoForm->id) }}" method="POST" class="d-inline"> @csrf @foreach ($filterParams ?? [] as $key => $value) @if ($value) <input type="hidden" name="{{ $key }}" value="{{ $value }}"> @endif @endforeach <button type="submit" class="btn btn-sm btn-warning"> <i class="fa-solid fa-user-plus me-1"></i>{{ __('Me adicionar a este chamado') }} </button> </form> @endif </div> <div class="border rounded p-2"> <div class="d-flex align-items-center gap-2 p-2 border-bottom"> <span class="badge bg-primary">Responsável</span> <span class="fw-semibold">{{ $chamadoForm->atendente->name ?? '—' }}</span> <small class="text-muted">{{ $chamadoForm->atendente->matriculation ?? '' }}</small> </div> @php $outrosParticipantes = $chamadoForm->participantes->where('id', '!=', $chamadoForm->atendente_id); @endphp @forelse ($outrosParticipantes as $participante) <div class="d-flex align-items-center gap-2 p-2 {{ !$loop->last ? 'border-bottom' : '' }}"> <span class="badge bg-secondary">Participante</span> <span>{{ $participante->name }}</span> <small class="text-muted">{{ $participante->matriculation }}</small> @if (!$isConcluido && ($participante->id === $userId || $isDiretorTi)) <form action="{{ route('admin.indicadoresTi.participantes.destroy', $chamadoForm->id) }}" method="POST" class="ms-auto"> @csrf @method('DELETE') <input type="hidden" name="user_id" value="{{ $participante->id }}"> @foreach ($filterParams ?? [] as $key => $value) @if ($value) <input type="hidden" name="{{ $key }}" value="{{ $value }}"> @endif @endforeach <button type="submit" class="btn btn-sm btn-outline-danger" title="Remover"> <i class="fa-solid fa-xmark"></i> </button> </form> @endif </div> @empty <p class="text-muted small p-2 mb-0">Nenhum participante adicional.</p> @endforelse @if (!$isConcluido && ($isAtendente || $isDiretorTi)) <div class="mt-2 pt-2 border-top"> <input type="text" class="form-control form-control-sm js-participante-search" data-chamado="{{ $chamadoForm->id }}" placeholder="{{ __('Buscar e adicionar participante...') }}" autocomplete="off"> <form id="form-add-participante-{{ $chamadoForm->id }}" action="{{ route('admin.indicadoresTi.participantes.store', $chamadoForm->id) }}" method="POST" class="d-none"> @csrf <input type="hidden" name="user_id" class="js-participante-user-id"> @foreach ($filterParams ?? [] as $key => $value) @if ($value) <input type="hidden" name="{{ $key }}" value="{{ $value }}"> @endif @endforeach </form> </div> @endif </div> </div> @endif @if ($isEdicao) <div class="mb-4"> <div class="fw-semibold text-uppercase small text-secondary border-bottom pb-2 mb-3"> <i class="fa-solid fa-timeline me-1"></i>{{ __('HISTÓRICO') }} </div> <div class="border rounded p-0"> @forelse ($chamadoForm->logs as $log) @php $tipoInfo = \App\Models\IndicadoresTi\ChamadoLog::TIPOS[$log->tipo] ?? [ 'label' => $log->tipo, 'icon' => 'fa-circle', 'color' => 'secondary', ]; @endphp <div class="d-flex align-items-start gap-3 p-3 {{ !$loop->last ? 'border-bottom' : '' }}"> <div class="text-{{ $tipoInfo['color'] }} pt-1" style="min-width: 20px; text-align: center;"> <i class="fa-solid {{ $tipoInfo['icon'] }}"></i> </div> <div class="flex-grow-1"> <div class="d-flex justify-content-between"> <span class="fw-semibold text-{{ $tipoInfo['color'] }}">{{ $tipoInfo['label'] }}</span> <small class="text-muted">{{ $log->created_at->format('d/m/Y H:i') }}</small> </div> <div class="text-muted small">{{ $log->conteudo }}</div> </div> </div> @empty <p class="text-muted small p-3 mb-0">Nenhum registro no histórico.</p> @endforelse </div> </div> @endif </div> @if ($isEdicao) <div class="modal fade" id="modal-concluir-{{ $chamadoForm->id }}" tabindex="-1" aria-labelledby="modal-concluir-label-{{ $chamadoForm->id }}" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="modal-concluir-label-{{ $chamadoForm->id }}"> {{ __('Concluir Chamado') }} </h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('Fechar') }}"></button> </div> <div class="modal-body"> {{ __('Deseja realmente marcar o chamado :numero como concluído?', ['numero' => $chamadoForm->numero ?? '']) }} </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ __('Cancelar') }}</button> <form action="{{ route('admin.indicadoresTi.concluir', $chamadoForm->id) }}" method="POST" class="d-inline"> @csrf @foreach ($filterParams ?? [] as $key => $value) @if ($value) <input type="hidden" name="{{ $key }}" value="{{ $value }}"> @endif @endforeach <button type="submit" class="btn btn-success"> <i class="fa-solid fa-check me-1"></i>{{ __('Confirmar') }} </button> </form> </div> </div> </div> </div> @endif
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings