Merge branch 'develop' into trunk
This commit is contained in:
commit
5bee68488f
4 changed files with 50 additions and 6 deletions
|
|
@ -8,8 +8,9 @@ use Kwaadpepper\Enum\BaseEnum;
|
|||
* @method static self new()
|
||||
* @method static self inprogress()
|
||||
* @method static self processed()
|
||||
* @method static self archived()
|
||||
* @method static self recette()
|
||||
* @method static self production()
|
||||
* @method static self archived()
|
||||
*/
|
||||
class TicketStatus extends BaseEnum
|
||||
{
|
||||
|
|
@ -19,8 +20,9 @@ class TicketStatus extends BaseEnum
|
|||
'new' => 1,
|
||||
'inprogress' => 2,
|
||||
'processed' => 3,
|
||||
'archived' => 4,
|
||||
'production' => 5
|
||||
'recette' => 4,
|
||||
'production' => 5,
|
||||
'archived' => 9,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -30,8 +32,9 @@ class TicketStatus extends BaseEnum
|
|||
'new' => trans('Nouveau'),
|
||||
'inprogress' => trans('En cours'),
|
||||
'processed' => trans('Traité'),
|
||||
'archived' => trans('Archivé'),
|
||||
'recette' => trans('En recettage'),
|
||||
'production' => trans('En production'),
|
||||
'archived' => trans('Archivé'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use App\Enums\TicketStatus;
|
||||
use App\Models\Ticket;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateTicketsStatusWithEnumStatus extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
foreach (Ticket::where('status', 4)->get() as $ticket) {
|
||||
$ticket->status = TicketStatus::archived();
|
||||
$ticket->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="content">
|
||||
<div class="content mt-5">
|
||||
@yield('content')
|
||||
</div>
|
||||
<script src="{{ asset('js/app.js') }}"></script>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,15 @@
|
|||
</td>
|
||||
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
|
||||
<td>{{ $ticket->user->name }}</td>
|
||||
<td>{{ $ticket->status->label }}</td>
|
||||
@php
|
||||
$cls = $ticket->status == TicketStatus::archived() ? 'text-secondary' : null;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::new()) ? 'text-danger' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::processed()) ? 'text-info' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::recette()) ? 'text-primary' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::production()) ? 'text-success' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::inprogress()) ? 'text-dark' : $cls;
|
||||
@endphp
|
||||
<td><span class="{{ $cls }}">{{ $ticket->status->label }}</span></td>
|
||||
<td>
|
||||
{{-- Modal du ticket --}}
|
||||
<!-- Button trigger modal -->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue