feat: ✨ added mep date on tickets
This commit is contained in:
parent
3836cc50e8
commit
f9c02af11b
7 changed files with 62 additions and 18 deletions
|
|
@ -96,6 +96,7 @@ class StoreTicket extends FormRequest
|
|||
}
|
||||
}
|
||||
],
|
||||
'date_mep' => 'required|date',
|
||||
'text' => 'required|string|min:40',
|
||||
'title' => 'required|string|between:3,255',
|
||||
'file_tickets' => 'sometimes|array',
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class Ticket extends Model
|
|||
'type',
|
||||
'status',
|
||||
'order',
|
||||
'date_mep',
|
||||
'text',
|
||||
'title',
|
||||
'is_internal',
|
||||
|
|
@ -48,6 +49,7 @@ class Ticket extends Model
|
|||
'is_internal' => 'bool',
|
||||
'type' => TicketTypeEnum::class,
|
||||
'status' => TicketStatusEnum::class,
|
||||
'date_mep' => 'date',
|
||||
'last_activity' => 'timestamp',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->date('date_mep')->nullable()->after('gitlab_issue')->comment('Date MEP souhaitée');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->dropColumn('date_mep');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -215,11 +215,13 @@ return [
|
|||
'year' => 'year',
|
||||
],
|
||||
'custom' => [
|
||||
'type' => 'type',
|
||||
'tickets' => 'tickets',
|
||||
'assigned_to' => 'assigned to',
|
||||
'order' => 'order',
|
||||
'priority' => 'priority',
|
||||
'default' => 'default',
|
||||
'type' => 'type',
|
||||
'tickets' => 'tickets',
|
||||
'assigned_to' => 'assigned to',
|
||||
'order' => 'order',
|
||||
'priority' => 'priority',
|
||||
'default' => 'default',
|
||||
'date_mep' => 'desired MEP date',
|
||||
'date_mep_empty' => 'no date entered'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -251,11 +251,13 @@ return [
|
|||
'id' => 'identifiant'
|
||||
],
|
||||
'custom' => [
|
||||
'type' => 'type',
|
||||
'tickets' => 'étiquettes',
|
||||
'assigned_to' => 'assigné à',
|
||||
'order' => 'ordre',
|
||||
'priority' => 'priorité',
|
||||
'default' => 'défaut',
|
||||
'type' => 'type',
|
||||
'tickets' => 'étiquettes',
|
||||
'assigned_to' => 'assigné à',
|
||||
'order' => 'ordre',
|
||||
'priority' => 'priorité',
|
||||
'default' => 'défaut',
|
||||
'date_mep' => 'date de MEP souhaitée',
|
||||
'date_mep_empty' => 'aucune date renseignée'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -93,6 +93,11 @@
|
|||
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
<div class="form-group col">
|
||||
<label class="col-form-label" for="date_mep">{{ __('Date de mise en production souhaitée') }}</label>
|
||||
<input class="form-control" id="date_mep" name="date_mep" type="date" min="{{ date('Y-m-j') }}" value="{{ old('date_mep') ?? (isset($ticket) && !is_null($ticket->date_mep) ? $ticket->date_mep->format('Y-m-j') : date('Y-m-j')) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
|
|
|
|||
|
|
@ -198,11 +198,8 @@
|
|||
if (Auth::user()->isAdmin()) {
|
||||
$cols = array_merge($cols, [
|
||||
'tickets' => Str::ucfirst(__('validation.custom.tickets')),
|
||||
]);
|
||||
}
|
||||
if (Auth::user()->isAdmin()) {
|
||||
$cols = array_merge($cols, [
|
||||
'assigned_to' => Str::ucfirst(__('validation.custom.assigned_to')),
|
||||
'date_mep' => Str::ucfirst(__('validation.custom.date_mep')),
|
||||
]);
|
||||
}
|
||||
$cols = array_merge($cols, [
|
||||
|
|
@ -211,7 +208,7 @@
|
|||
@endphp
|
||||
@include('bo.modules.table-col-sorter', [
|
||||
'cols' => $cols,
|
||||
'ignore' => ['id', 'tickets', 'order']
|
||||
'ignore' => ['id', 'tickets'],
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -278,9 +275,12 @@
|
|||
</span>
|
||||
</td>
|
||||
@endcan
|
||||
{{-- assigned_to --}}
|
||||
{{-- assigned_to / date_mep --}}
|
||||
@if (Auth::user()->isAdmin())
|
||||
<td>{{ $ticket->assignedUser ? $ticket->assignedUser->name : __('Personne') }}</td>
|
||||
<td>
|
||||
{{ is_null($ticket->date_mep) ? Str::ucfirst(__("validation.custom.date_mep_empty")) : $ticket->date_mep->format('d/m/Y') }}
|
||||
</td>
|
||||
@endif
|
||||
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue