]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5697 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Jan 2023 08:49:24 +0000 (09:49 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Jan 2023 08:49:24 +0000 (09:49 +0100)
app/Console/Commands/FluidbookQuote.php [new file with mode: 0644]
app/Console/Kernel.php
app/Jobs/FluidbookCompiler.php

diff --git a/app/Console/Commands/FluidbookQuote.php b/app/Console/Commands/FluidbookQuote.php
new file mode 100644 (file)
index 0000000..cac8066
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Models\User;
+use App\Slack\Slack;
+use Backpack\CRUD\app\Library\Widget;
+use Cubist\Backpack\Console\Commands\CubistCommand;
+use Cubist\Backpack\Facades\App;
+
+class FluidbookQuote extends CubistCommand
+{
+    protected $signature = 'fluidbook:quote {--reminder}';
+    protected $description = 'Fluidbook Quotes';
+
+    public function handle()
+    {
+        if ($this->option('reminder')) {
+            return $this->reminder();
+        }
+    }
+
+    protected function reminder()
+    {
+        App::setLocale('fr');
+        $nottreated = \App\Models\FluidbookQuote::where('status', '0')->count();
+        if ($nottreated > 0 && request()->get('status', null) == null) {
+            Slack::send(User::withoutGlobalScopes()->find('5')->slack/*Slack::fluidbookQuoteChannel*/,
+                ':alarm_clock: ' . __('Des demandes de devis n\'ont pas été traitées'),
+                __(':awaiting demandes de devis doivent être confiées à un revendeur ou un chef de projet', ['awaiting' => $nottreated]),
+                [__('Toutes les demandes') => ['url' => backpack_url('fluidbook-quote?status=0')]],
+                false,
+            );
+        }
+
+
+    }
+}
index d29a03397421ce7e0f42d5b20b698f6ef0f6461f..a461fe9061497e1f44226a5f42b661f0a7619776 100644 (file)
@@ -31,6 +31,8 @@ class Kernel extends \Cubist\Backpack\Console\Kernel
 
         $schedule->command('ws:migrate --publications=v2 --documents=missing')->dailyAt('1:00');
 
+        $schedule->command('fluidbook:quote --reminder')->weekdays()->at('10:00');
+
         $schedule->command('job:dispatch ProcessTotals')->everyTwoHours();
         $schedule->command('fluidbook:player:updatesources')->everyTwoHours();
 
index 80b80b20a2906cc070c86b56d53dd6ebc4046f16..70181d5afe66edc115070da9e7753679664665a2 100644 (file)
@@ -3304,7 +3304,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             $less->setArg(null, $destination_less);
             $less->setArg(null, $destination_css);
             $less->execute();
-            $less->debug();
             if (!file_exists($destination_css)) {
                 die($less->output);
                 continue;