From 766007f23df0a3ebfeaae5e2dcb6027497c89e58 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 20 Jun 2023 10:41:36 +0200 Subject: [PATCH] wip #5788 @0:30 --- app/Http/Controllers/Admin/CommandCrudController.php | 2 +- app/Http/Controllers/AjaxController.php | 6 +++--- .../Client/CustomResetPasswordNotification.php | 5 ----- .../Controllers/Client/ForgotPasswordController.php | 5 ----- app/Models/AuthClient.php | 1 - app/Models/{Command.php => Order.php} | 10 +++++----- app/Templates/MyOrder.php | 4 ++-- resources/lang/en/mail.php | 2 +- resources/lang/fr/mail.php | 2 +- resources/views/components/item-cart-order.blade.php | 12 +++++++----- 10 files changed, 20 insertions(+), 29 deletions(-) rename app/Models/{Command.php => Order.php} (84%) diff --git a/app/Http/Controllers/Admin/CommandCrudController.php b/app/Http/Controllers/Admin/CommandCrudController.php index 45618f5..5730a29 100644 --- a/app/Http/Controllers/Admin/CommandCrudController.php +++ b/app/Http/Controllers/Admin/CommandCrudController.php @@ -4,7 +4,7 @@ namespace App\Http\Controllers\Admin; class CommandCrudController extends \Cubist\Backpack\app\Magic\Controllers\CubistMagicController { - protected $_modelNamespace = 'App\Models\Command'; + protected $_modelNamespace = 'App\Models\Order'; protected $_routeURL = 'command'; protected $_singular = 'Commande'; protected $_plural = 'Commandes'; diff --git a/app/Http/Controllers/AjaxController.php b/app/Http/Controllers/AjaxController.php index 39b9a1d..510aa02 100644 --- a/app/Http/Controllers/AjaxController.php +++ b/app/Http/Controllers/AjaxController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use App\Models\Command; +use App\Models\Order; use App\Models\Panier; use Cubist\Backpack\Facades\App; use App\Models\Page; @@ -700,10 +700,10 @@ class AjaxController extends CubistFrontController $productsInfosBase = Product::getProductsByIds($ids); $currentCartRef = Panier::getRefs($data['products']); - $data = Command::fillData($currentCartRef,$data,$productsInfosBase); + $data = Order::fillData($currentCartRef,$data,$productsInfosBase); if($data) { - $order = Command::create($data); + $order = Order::create($data); $order->save(); }else{ abort('422', 'Datas are empty'); diff --git a/app/Http/Controllers/Client/CustomResetPasswordNotification.php b/app/Http/Controllers/Client/CustomResetPasswordNotification.php index 626765b..856c29d 100644 --- a/app/Http/Controllers/Client/CustomResetPasswordNotification.php +++ b/app/Http/Controllers/Client/CustomResetPasswordNotification.php @@ -12,11 +12,6 @@ class CustomResetPasswordNotification extends ResetPassword $this->token = $token; } - public function via($notifiable) - { - return ['mail']; - } - public function toMail($notifiable) { return (new MailMessage()) diff --git a/app/Http/Controllers/Client/ForgotPasswordController.php b/app/Http/Controllers/Client/ForgotPasswordController.php index 5930aee..bf19754 100644 --- a/app/Http/Controllers/Client/ForgotPasswordController.php +++ b/app/Http/Controllers/Client/ForgotPasswordController.php @@ -3,15 +3,10 @@ namespace App\Http\Controllers\Client; use App\Models\AuthClient; -use App\Models\Client; -use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification; use Carbon\Carbon; -use Cubist\Backpack\Facades\App; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; -use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\DB; -use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Password; class ForgotPasswordController diff --git a/app/Models/AuthClient.php b/app/Models/AuthClient.php index e457608..221381c 100644 --- a/app/Models/AuthClient.php +++ b/app/Models/AuthClient.php @@ -1,7 +1,6 @@ 'command', - 'singular' => 'Commande', - 'plural' => 'Commandes']; + protected $_options = ['name' => 'order', + 'singular' => 'Order', + 'plural' => 'Orders']; private static $_optionsForSelect = [ 'new' => 'Nouvelle', diff --git a/app/Templates/MyOrder.php b/app/Templates/MyOrder.php index 99a4efa..57e1956 100644 --- a/app/Templates/MyOrder.php +++ b/app/Templates/MyOrder.php @@ -3,7 +3,7 @@ namespace App\Templates; -use App\Models\Command; +use App\Models\Order; class MyOrder extends Base { @@ -14,7 +14,7 @@ class MyOrder extends Base public function setData(&$data) { - $data["items"] = Command::getAllByUserId(); + $data["items"] = Order::getAllByUserId(); } public function init() diff --git a/resources/lang/en/mail.php b/resources/lang/en/mail.php index 680076e..32173a4 100644 --- a/resources/lang/en/mail.php +++ b/resources/lang/en/mail.php @@ -4,5 +4,5 @@ return [ 'regards' => 'Regards', 'footer_part1' => 'If you’re having trouble clicking the', 'footer_part2' => 'button, copy and paste the URL below', - 'footer_part3' => ' into your web browser:
', + 'footer_part3' => " into your web browser:\n\n", ]; diff --git a/resources/lang/fr/mail.php b/resources/lang/fr/mail.php index d4a4a6a..d0448c1 100644 --- a/resources/lang/fr/mail.php +++ b/resources/lang/fr/mail.php @@ -4,5 +4,5 @@ return [ 'regards' => 'Salutations', 'footer_part1' => 'Si vous ne parvenez pas à cliquer sur le bouton', 'footer_part2' => "copiez et collez l'URL ci-dessous", - 'footer_part3' => 'dans votre navigateur Web:
', + 'footer_part3' => "dans votre navigateur Web :\n\n", ]; diff --git a/resources/views/components/item-cart-order.blade.php b/resources/views/components/item-cart-order.blade.php index bfe65e4..b0d063b 100644 --- a/resources/views/components/item-cart-order.blade.php +++ b/resources/views/components/item-cart-order.blade.php @@ -15,7 +15,8 @@
@foreach(json_decode($item['products'], true) as $key => $product) -
+
@@ -39,7 +40,8 @@ @endif @endisset @endif -

{{ __('Quantité') }} : {{$product['quantity']}}

+

{{ __('Quantité') }} : {{$product['quantity']}}

@if(floatval($product['price'])) @@ -48,8 +50,8 @@

N/A ? + data-tooltip="{{__('Prix sur devis.')}}" + class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-3">?

@endif
@@ -62,7 +64,7 @@

{{ __('Statut') }}

- {{ \App\Models\Command::getOptionValue($item['status']) }} + {{ \App\Models\Order::getOptionValue($item['status']) }} @if($item['complete_status']) · {{ $item['complete_status'] }} @endif -- 2.39.5