]> _ Git - pmi.git/commitdiff
wip #5788 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Tue, 20 Jun 2023 08:41:36 +0000 (10:41 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 20 Jun 2023 08:41:36 +0000 (10:41 +0200)
app/Http/Controllers/Admin/CommandCrudController.php
app/Http/Controllers/AjaxController.php
app/Http/Controllers/Client/CustomResetPasswordNotification.php
app/Http/Controllers/Client/ForgotPasswordController.php
app/Models/AuthClient.php
app/Models/Command.php [deleted file]
app/Models/Order.php [new file with mode: 0644]
app/Templates/MyOrder.php
resources/lang/en/mail.php
resources/lang/fr/mail.php
resources/views/components/item-cart-order.blade.php

index 45618f5784ee4372a876e2089c23cc1af4dd1e32..5730a299d972b496c8ad70b5fe8ab79bd1da1e98 100644 (file)
@@ -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';
index 39b9a1d9c23ff05836a2fefef24bd61542c3e328..510aa0225d7d03af2574187f24b51877d41abab7 100644 (file)
@@ -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');
index 626765b8bb76787cd8d09be2579364832d3ced60..856c29da8ca01c8359b2cf8f325d50942cf58655 100644 (file)
@@ -12,11 +12,6 @@ class CustomResetPasswordNotification extends ResetPassword
         $this->token = $token;
     }
 
-    public function via($notifiable)
-    {
-        return ['mail'];
-    }
-
     public function toMail($notifiable)
     {
         return (new MailMessage())
index 5930aeed49acc413d340367a3c1075171ab06e69..bf19754b40befa80e9085eaa47bb90be37fff768 100644 (file)
@@ -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
index e457608cb9d4f655a3dd556be1886d62e304a815..221381cbe3a249019f8a1eed24bca16a3c47108a 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace App\Models;
 
-use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification;
 use Cubist\Backpack\Facades\App;
 use Illuminate\Auth\Passwords\CanResetPassword;
 use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
diff --git a/app/Models/Command.php b/app/Models/Command.php
deleted file mode 100644 (file)
index 58795b6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-namespace App\Models;
-
-class Command extends CommandPanierSchema
-{
-    protected $table = 'command';
-
-    protected $_options = ['name' => 'command',
-        'singular' => 'Commande',
-        'plural' => 'Commandes'];
-
-    private static $_optionsForSelect = [
-        'new' => 'Nouvelle',
-        'pending' => 'En attente de règlement',
-        'in_progress' => 'En cours',
-        'done' => 'Clôturée',
-    ];
-
-    public function setFields()
-    {
-        parent::setFields();
-
-        foreach ($this->fields as $fields) {
-            $fields['tab'] = 'Informations';
-            $this->addField($fields);
-        }
-
-        $this->addField(['name' => 'status',
-            'label' => 'Statut',
-            'type' => 'SelectFromArray',
-            'column' => true,
-            'options' => self::$_optionsForSelect,
-            'default'     => 'new',
-            'tab' => 'Informations'
-        ]);
-
-        $this->addField(['name' => 'complete_status',
-            'label' => 'Indication du statut',
-            'type' => 'Text',
-            'tab' => 'Informations'
-        ]);
-    }
-
-    public static function getOptionValue($key) {
-        if($key)
-            return self::$_optionsForSelect[$key];
-
-        return false;
-    }
-}
diff --git a/app/Models/Order.php b/app/Models/Order.php
new file mode 100644 (file)
index 0000000..7f9afb2
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+namespace App\Models;
+
+class Order extends CommandPanierSchema
+{
+    protected $table = 'order';
+
+    protected $_options = ['name' => 'order',
+        'singular' => 'Order',
+        'plural' => 'Orders'];
+
+    private static $_optionsForSelect = [
+        'new' => 'Nouvelle',
+        'pending' => 'En attente de règlement',
+        'in_progress' => 'En cours',
+        'done' => 'Clôturée',
+    ];
+
+    public function setFields()
+    {
+        parent::setFields();
+
+        foreach ($this->fields as $fields) {
+            $fields['tab'] = 'Informations';
+            $this->addField($fields);
+        }
+
+        $this->addField(['name' => 'status',
+            'label' => 'Statut',
+            'type' => 'SelectFromArray',
+            'column' => true,
+            'options' => self::$_optionsForSelect,
+            'default'     => 'new',
+            'tab' => 'Informations'
+        ]);
+
+        $this->addField(['name' => 'complete_status',
+            'label' => 'Indication du statut',
+            'type' => 'Text',
+            'tab' => 'Informations'
+        ]);
+    }
+
+    public static function getOptionValue($key) {
+        if($key)
+            return self::$_optionsForSelect[$key];
+
+        return false;
+    }
+}
index 99a4efa742b1fa4414c624ce8f83d7faccfa727e..57e1956af1175b8736c793a373e3b93dcdc1fcad 100644 (file)
@@ -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()
index 680076edc383965714e14757a0675e1eca59917a..32173a4cefde9bf9f0d306a3322f8ed9e070a468 100644 (file)
@@ -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:<br class="util">',
+    'footer_part3' => " into your web browser:\n\n",
 ];
index d4a4a6a5384f3d2cef50224abbeafca502bfe92c..d0448c174339f77b746caf159af6fa52e26b6dd2 100644 (file)
@@ -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:<br class="util">',
+    'footer_part3' => "dans votre navigateur Web :\n\n",
 ];
index bfe65e44915140864d10a8a276f8d269f661ba9c..b0d063b7a816c498f4baeb580efe5f55583e195f 100644 (file)
@@ -15,7 +15,8 @@
         <div class="cartsave-products">
             @foreach(json_decode($item['products'], true) as $key => $product)
                 <grid gap="md" class="sm:grid-cols-1 cartsave-grid">
-                    <div class="product-thumbnail bg-center bg-contain bg-no-repeat" style='background-image : url("{{ $product['image'] }}")'>
+                    <div class="product-thumbnail bg-center bg-contain bg-no-repeat"
+                         style='background-image : url("{{ $product['image'] }}")'>
                     </div>
                     <div class="product-infos flex justify-between items-center">
                         <div>
@@ -39,7 +40,8 @@
                                     @endif
                                 @endisset
                             @endif
-                            <p class="no-m">{{ __('Quantité') }} : <span class="text-navy">{{$product['quantity']}}</span></p>
+                            <p class="no-m">{{ __('Quantité') }} : <span
+                                        class="text-navy">{{$product['quantity']}}</span></p>
                         </div>
                         <div class="product-price">
                             @if(floatval($product['price']))
@@ -48,8 +50,8 @@
                                 <p class="text-navy">
                                     N/A
                                     <span
-                                        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">?</span>
+                                            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">?</span>
                                 </p>
                             @endif
                         </div>
@@ -62,7 +64,7 @@
                 <div>
                     <p class="no-m">{{ __('Statut') }}</p>
                     <p class="no-m text-navy">
-                        {{ \App\Models\Command::getOptionValue($item['status']) }}
+                        {{ \App\Models\Order::getOptionValue($item['status']) }}
                         @if($item['complete_status'])
                             &#183;&nbsp;{{ $item['complete_status'] }}
                         @endif