Browse Source

Att: adicionando opção de selecionar a unica opcao da ura automaticamente

chatbot
Felipe Fontana 5 months ago
parent
commit
505450fc80
  1. 4
      app/Http/Controllers/Admin/ConfigAtendimentoController.php
  2. 3
      app/Models/ConfigAtendimento.php
  3. 249
      resources/views/admin/configs/configs.blade.php

4
app/Http/Controllers/Admin/ConfigAtendimentoController.php

@ -46,6 +46,7 @@ class ConfigAtendimentoController extends Controller
'allow_transbordo' => 'required',
'allow_realocar' => 'required',
'allow_contato_global' => 'required',
'allow_opcao_unica' => 'required'
], [
'required' => 'É preciso informar o campo :attribute.'
]);
@ -96,7 +97,8 @@ class ConfigAtendimentoController extends Controller
"hide_alerts" => $request->hide_alerts,
"allow_transbordo" => $request->allow_transbordo,
"allow_realocar" => $request->allow_realocar,
"allow_contato_global" => $request->allow_contato_global
"allow_contato_global" => $request->allow_contato_global,
"allow_opcao_unica" => $request->allow_opcao_unica
]);
return redirect('configs')->with('status', 'Configurações Editadas!');

3
app/Models/ConfigAtendimento.php

@ -25,7 +25,8 @@ class ConfigAtendimento extends Model
"hide_alerts",
"allow_transbordo",
"allow_realocar",
"allow_contato_global"
"allow_contato_global",
"allow_opcao_unica"
];
}

249
resources/views/admin/configs/configs.blade.php

@ -16,131 +16,152 @@
<input type="hidden" value="{{$configAtendimento->id_empresa}}" name="id_empresa">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<div class="max-w-xl">
<div>
<header>
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
Configuração Atendimento
</h2>
</header> </br> </br>
<div>
<x-input-label for="qtde_atendimento" :value="__('Quantidade máxima de atendimentos simultâneos por agente:')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui a quantidade : " value="{{$configAtendimento->quantidade_simutaneo}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="qtde_atendimento" />
</div>
</br>
@if ($alterar_licencas)
<div>
<x-input-label for="qtde_logados" :value="__('Quantidade máxima de agentes logados:')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui a quantidade : " value="{{$configAtendimento->quantidade_logados}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="qtde_logados" />
</div>
</br>
<div>
<x-input-label for="qtde_logados" :value="__('Quantidade de licenças fixas de usuário:')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui a quantidade : " value="{{$configAtendimento->fixed_licenses}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="fixed_licenses" />
</div>
</br>
@else
<input type="hidden" value="{{$configAtendimento->quantidade_logados}}" name="qtde_logados">
<input type="hidden" value="{{$configAtendimento->fixed_licenses}}" name="fixed_licenses">
@endif
<div>
<x-input-label for="hide_nome" :value="__('Esconder nome do agente:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="hide_nome">
@if($configAtendimento->hide_nome)
<option value="false" >Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true" >Sim</option>
@endif
</select>
</div>
</br>
<div>
<x-input-label for="hide_alerts" :value="__('Esconder alertas de perda de conexão:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="hide_alerts">
@if($configAtendimento->hide_alerts)
<option value="false" >Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true" >Sim</option>
@endif
</select>
</div>
</br>
<div>
<x-input-label for="hide_alerts" :value="__('Permitir transbordo das filas de atendimento:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_transbordo">
@if($configAtendimento->allow_transbordo)
<option value="false" >Não</option>
<option value="true" selected>Sim</option>
</header>
<br><br>
<div style="display: flex; flex-wrap: wrap;">
<!-- Left Column -->
<div style="flex: 1; padding-right: 16px; box-sizing: border-box;">
<div style="margin-bottom: 16px;">
<x-input-label for="qtde_atendimento" :value="__('Quantidade máxima de atendimentos simultâneos por agente:')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui a quantidade : " value="{{$configAtendimento->quantidade_simutaneo}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="qtde_atendimento" />
</div>
@if ($alterar_licencas)
<div style="margin-bottom: 16px;">
<x-input-label for="qtde_logados" :value="__('Quantidade máxima de agentes logados:')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui a quantidade : " value="{{$configAtendimento->quantidade_logados}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="qtde_logados" />
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="qtde_logados" :value="__('Quantidade de licenças fixas de usuário:')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui a quantidade : " value="{{$configAtendimento->fixed_licenses}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="fixed_licenses" />
</div>
@else
<option value="false" selected>Não</option>
<option value="true" >Sim</option>
<input type="hidden" value="{{$configAtendimento->quantidade_logados}}" name="qtde_logados">
<input type="hidden" value="{{$configAtendimento->fixed_licenses}}" name="fixed_licenses">
@endif
</select>
</div>
</br>
<div>
<x-input-label for="hide_alerts" :value="__('Permitir realocar os atendimentos caso o agente perca a conexão:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_realocar">
@if($configAtendimento->allow_realocar)
<option value="false" >Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true" >Sim</option>
@endif
</select>
</div>
</br>
<div>
<x-input-label for="hide_alerts" :value="__('Contatos salvos servirão para todos agentes:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_contato_global">
@if($configAtendimento->allow_contato_global)
<option value="false" >Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true" >Sim</option>
@endif
</select>
<div style="margin-bottom: 16px;">
<x-input-label for="hide_nome" :value="__('Esconder nome do agente:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="hide_nome">
@if($configAtendimento->hide_nome)
<option value="false">Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true">Sim</option>
@endif
</select>
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="allow_opcao_unica" :value="__('Selecionar automaticamente a opção do menu se ela for única:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_opcao_unica">
@if($configAtendimento->allow_opcao_unica)
<option value="false">Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true">Sim</option>
@endif
</select>
</div>
</div>
<!-- Right Column -->
<div style="flex: 1; padding-left: 16px; box-sizing: border-box;">
<div style="margin-bottom: 16px;">
<x-input-label for="hide_alerts" :value="__('Esconder alertas de perda de conexão:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="hide_alerts">
@if($configAtendimento->hide_alerts)
<option value="false">Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true">Sim</option>
@endif
</select>
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="allow_transbordo" :value="__('Permitir transbordo das filas de atendimento:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_transbordo">
@if($configAtendimento->allow_transbordo)
<option value="false">Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true">Sim</option>
@endif
</select>
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="allow_realocar" :value="__('Permitir realocar os atendimentos caso o agente perca a conexão:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_realocar">
@if($configAtendimento->allow_realocar)
<option value="false">Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true">Sim</option>
@endif
</select>
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="allow_contato_global" :value="__('Contatos salvos servirão para todos agentes:')" />
<select class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="allow_contato_global">
@if($configAtendimento->allow_contato_global)
<option value="false">Não</option>
<option value="true" selected>Sim</option>
@else
<option value="false" selected>Não</option>
<option value="true">Sim</option>
@endif
</select>
</div>
</div>
</div>
</div>
</div>
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<div class="max-w-xl">
<header>
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
Configuração Timeout
</h2>
</header> </br> </br>
<div>
<x-input-label for="timeout_cliente" :value="__('Cliente (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em segundos:" value="{{$configAtendimento->timeout_client / 60}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_cliente" />
</div>
</br>
<div>
<x-input-label for="timeout_agente" :value="__('Agente (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em segundos:" value="{{$configAtendimento->timeout_agent / 60}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_agente" />
</div>
</br>
<div>
<x-input-label for="timeout_espera" :value="__('Tempo em espera (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em minutos:" value="{{$configAtendimento->timeout_espera}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_espera" />
</div>
</br>
<div>
<x-input-label for="timeout_supervisor" :value="__('Agente Indisponível (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em minutos:" value="{{$configAtendimento->timeout_supervisor}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_supervisor" />
</div>
</br>
<div class="flex items-center gap-4">
<x-primary-button>{{ __('Salvar') }}</x-primary-button>
</div>
</div>
</div>
<div class="max-w-xl">
<header>
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
Configuração Timeout
</h2>
</header>
<br><br>
<div style="display: flex; flex-wrap: wrap;">
<!-- Left Column -->
<div style="flex: 1; padding-right: 16px; box-sizing: border-box;">
<div style="margin-bottom: 16px;">
<x-input-label for="timeout_cliente" :value="__('Cliente (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em segundos:" value="{{$configAtendimento->timeout_client / 60}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_cliente" />
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="timeout_agente" :value="__('Agente (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em segundos:" value="{{$configAtendimento->timeout_agent / 60}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_agente" />
</div>
</div>
<!-- Right Column -->
<div style="flex: 1; padding-left: 16px; box-sizing: border-box;">
<div style="margin-bottom: 16px;">
<x-input-label for="timeout_espera" :value="__('Tempo em espera (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em minutos:" value="{{$configAtendimento->timeout_espera}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_espera" />
</div>
<div style="margin-bottom: 16px;">
<x-input-label for="timeout_supervisor" :value="__('Agente Indisponível (em minutos):')" />
<x-text-input type="text" maxlength="9" placeholder="Digite aqui o timeout em minutos:" value="{{$configAtendimento->timeout_supervisor}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="timeout_supervisor" />
</div>
</div>
</div>
<br>
<div class="flex items-center gap-4">
<x-primary-button>{{ __('Salvar') }}</x-primary-button>
</div>
</div>
</div>
</div>
</form>
</div>

Loading…
Cancel
Save