]> _ Git - fluidbook-toolbox.git/commitdiff
wip #3753 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Nov 2021 16:42:11 +0000 (17:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Nov 2021 16:42:11 +0000 (17:42 +0100)
.idea/csv-plugin.xml [new file with mode: 0644]
app/Console/Commands/WorkshopMigration.php
app/Mail/FluidbookQuoteAssign.php
app/Models/FluidbookQuote.php
app/Widgets.php
public/packages/fluidbook/toolbox/css/style.less
resources/views/vendor/backpack/crud/buttons/fluidbook_quote/assign.blade.php

diff --git a/.idea/csv-plugin.xml b/.idea/csv-plugin.xml
new file mode 100644 (file)
index 0000000..6143e03
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CsvFileAttributes">
+    <option name="attributeMap">
+      <map>
+        <entry key="\vendor\umpirsky\country-list\data\en_NZ\country.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+        <entry key="\vendor\umpirsky\country-list\data\ms\country.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+        <entry key="\vendor\umpirsky\locale-list\data\ar_KW\locales.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+        <entry key="\vendor\umpirsky\locale-list\data\az_AZ\locales.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+        <entry key="\vendor\umpirsky\locale-list\data\de_AT\locales.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+        <entry key="\vendor\umpirsky\locale-list\data\en_NZ\locales.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+        <entry key="\vendor\umpirsky\locale-list\data\en_PH\locales.csv">
+          <value>
+            <Attribute>
+              <option name="separator" value="," />
+            </Attribute>
+          </value>
+        </entry>
+      </map>
+    </option>
+  </component>
+</project>
\ No newline at end of file
index 66893dbf31a194dcc627e1ca05343f5e6f58d668..e6f262803a2ab66b9ad57ab890e0badbde0b7182 100644 (file)
@@ -19,10 +19,9 @@ class WorkshopMigration extends CubistCommand
     {
         $actions = [
             //'Backup current database' => 'backup',
-            //'Import Quotes' => 'importQuotes',
+            'Import Quotes' => 'importQuotes',
             'Migrate magic models' => 'migrate',
-            'Import publications' => 'importPublications',
-
+            //'Import publications' => 'importPublications',
             'Clean caches' => 'cleanCache'
         ];
 
@@ -44,18 +43,18 @@ class WorkshopMigration extends CubistCommand
 
     protected function migrate()
     {
-        $this->executeProcessQuiet('php artisan cubist:magic:generate');
-        $this->executeProcessQuiet('php artisan cubist:magic:migrate');
+        $this->executeProcessQuiet('/usr/bin/php8.0 artisan cubist:magic:generate');
+        $this->executeProcessQuiet('/usr/bin/php8.0 artisan cubist:magic:migrate');
     }
 
     protected function backup()
     {
-        $this->executeProcessQuiet('php artisan backup:run');
+        $this->executeProcessQuiet('/usr/bin/php8.0 artisan backup:run');
     }
 
     protected function cleanCache()
     {
-        $this->executeProcessQuiet('php artisan optimize:clear');
+        $this->executeProcessQuiet('/usr/bin/php8.0 artisan optimize:clear');
     }
 
 
@@ -89,11 +88,13 @@ class WorkshopMigration extends CubistCommand
             foreach ($map as $old => $new) {
                 $c->setAttribute($new, $e->$old);
             }
+            $c->created_ok = 1;
             $c->save();
         }
     }
 
-    protected function importPublications(){
+    protected function importPublications()
+    {
 
     }
 }
index 3ec0d6441b4a8bd7b07f70178d4fdcd80a2f3805..ffb26b0103e36f43fcac6e98b25c8aac98a92624 100644 (file)
@@ -40,7 +40,7 @@ class FluidbookQuoteAssign extends Mailable
         $resselerLocale = $reseller->locale;
         $user = User::where('id', $quote->user)->first();
         //$this->to($reseller->email);
-        $this->to('vincent+' . $quote->reseller . '@fluidbook.com');
+        $this->to($reseller->email);
         $this->bcc('tech@fluidbook.com');
         $this->subject('[Fluidbook Workshop] ' . __('Demande de devis', [], $resselerLocale));
 
index 08b95a9a012a7bc0b3ae7d6f863613097e46e126..e728054aefa21bc0490dd818f25b402e6b920784 100644 (file)
@@ -85,7 +85,7 @@ class FluidbookQuote extends CubistMagicAbstractModel
             ['optionsmodel' => User::class, 'allows_null' => true, 'attribute' => 'nameWithCompany', 'column_attribute' => 'companyName', 'column' => true, 'can' => 'fluidbook-quote:admin',]);
 
         $this->addField('status', 'SelectFromArray', __('Status'), ['options' => [
-            0 => __('Non traitée'),
+            0 => __('A confier'),
             1 => __('En attente'),
             2 => __('Traitée'),
         ], 'column' => true, 'filter' => true, 'can_write' => 'fluidbook-quote:admin']);
index 7ae3158ac0c1a0b9fc30a214aac3d29026c03b41..87c8e18b16e40062045ec38d0647e0b63ad0cfc3 100644 (file)
@@ -18,7 +18,7 @@ class Widgets
                     'type' => 'alert',
                     'class' => 'alert alert-dark mb-2',
                     'heading' => __('Des demandes de devis n\'ont pas été traitées'),
-                    'content' => __(':awaiting demandes de devis doivent être traitées', ['awaiting' => $nottreated]) . '. <p><a class="btn btn-primary" href="' . backpack_url('fluidbook-quote?status=0') . '">' . __('Voir toutes les demandes en attente') . '</a></p>',
+                    'content' => __(':awaiting demandes de devis doivent être confiées à un revendeur ou un chef de projet', ['awaiting' => $nottreated]) . '. <p><a class="btn btn-primary" href="' . backpack_url('fluidbook-quote?status=0') . '">' . __('Voir toutes les demandes à traiter') . '</a></p>',
                     'close_button' => false, // show close button or not
                 ]);
             }
@@ -26,11 +26,18 @@ class Widgets
 
         $awaiting = FluidbookQuote::where('status', '1')->count();
         if ($awaiting > 0 && request()->get('status', null) == null) {
+            if (can('fluidbook-quote:admin')) {
+                $heading = __('Des demandes de devis sont en attente');
+                $content = __(':awaiting demandes de devis n\'ont pas été prises en compte par le revendeur ou le chef de projet', ['awaiting' => $awaiting]);
+            } else {
+                $heading = __('Des demandes de devis sont en attente');
+                $content = __(':awaiting demandes de devis sont actuellement en attente', ['awaiting' => $awaiting]);
+            }
             Widget::add([
                 'type' => 'alert',
                 'class' => 'alert alert-danger mb-2',
-                'heading' => __('Des demandes de devis sont en attente'),
-                'content' => __(':awaiting demandes de devis sont actuellement en attente', ['awaiting' => $awaiting]) . '. <p><a class="btn btn-warning" href="' . backpack_url('fluidbook-quote?status=1') . '">' . __('Voir toutes les demandes en attente') . '</a></p>',
+                'heading' => $heading,
+                'content' => $content . '. <p><a class="btn btn-warning" href="' . backpack_url('fluidbook-quote?status=1') . '">' . __('Voir toutes les demandes en attente') . '</a></p>',
                 'close_button' => false, // show close button or not
             ]);
         }
index 014d49f3abd9087a2dfafc5239faf683bc2ad3c0..f41144b2269d004ce1095f597341cd9243120d79 100644 (file)
@@ -275,10 +275,18 @@ a, a.btn-link {
     background-color: @text-color;
 }
 
-[data-fluidbook-quote-status="1"] {
+[data-fluidbook-quote-status="0"] {
     color: #a00;
 }
 
+[data-fluidbook-quote-status="1"] {
+    color: #d33000;
+}
+
+[data-fluidbook-quote-status="2"] {
+    color: #156700;
+}
+
 .btn-link {
     .la {
         position: relative;
index 7e5330cd18ce56dc3cd3f7f868d41f1b23a61c53..fc8dad031f0083181e1287ef9003039300b9f529 100644 (file)
@@ -75,6 +75,7 @@
         <select class="assign" data-id="{{$entry->getKey()}}">
             <option value="null">-</option>
             <option value="{{backpack_user()->id}}">{{__('Je vais traiter la demander')}}</option>
+            <option value="5256">{{__('Confier à :reseller',['reseller'=>'Mallaury'])}}</option>
             <option value="94">{{__('Confier à :reseller',['reseller'=>'Kadreo'])}}</option>
         </select>
     </a>