]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5127 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 2 Mar 2022 10:16:56 +0000 (11:16 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 2 Mar 2022 10:16:56 +0000 (11:16 +0100)
.idea/workspace.xml
app/Console/Commands/Precache.php
app/Fields/FluidbookID.php

index 7acd482c20308bae2e706de17295bcaadce3b3d4..f21fc529f82b494e74e8af0005e7e43d95851c3d 100644 (file)
     <select />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wait #5127 @1">
-      <change beforePath="$PROJECT_DIR$/app/Models/User.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/User.php" afterDir="false" />
+    <list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wait #5127">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Console/Commands/Precache.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Console/Commands/Precache.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Fields/FluidbookID.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Fields/FluidbookID.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1645813363450" duration="1335000" />
       <workItem from="1646037639313" duration="11147000" />
       <workItem from="1646075990525" duration="933000" />
-      <workItem from="1646214502173" duration="1183000" />
-    </task>
-    <task id="LOCAL-00208" summary="wait #4928 @2">
-      <created>1638882262775</created>
-      <option name="number" value="00208" />
-      <option name="presentableId" value="LOCAL-00208" />
-      <option name="project" value="LOCAL" />
-      <updated>1638882262775</updated>
+      <workItem from="1646214502173" duration="1590000" />
     </task>
     <task id="LOCAL-00209" summary="wait #4928 @0.25">
       <created>1638884222979</created>
       <option name="project" value="LOCAL" />
       <updated>1646215674310</updated>
     </task>
-    <option name="localTasksCounter" value="257" />
+    <task id="LOCAL-00257" summary="wait #5127">
+      <created>1646215700961</created>
+      <option name="number" value="00257" />
+      <option name="presentableId" value="LOCAL-00257" />
+      <option name="project" value="LOCAL" />
+      <updated>1646215700961</updated>
+    </task>
+    <option name="localTasksCounter" value="258" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
     <option name="CHECK_NEW_TODO" value="false" />
     <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
-    <MESSAGE value="wip #5041 @0.75" />
     <MESSAGE value="wait #5049 @0.25" />
     <MESSAGE value="wip #5045 @0.25" />
     <MESSAGE value="wip #5045 @1" />
     <MESSAGE value="wip #5127" />
     <MESSAGE value="wait #5127 @1.5" />
     <MESSAGE value="wait #5127 @1" />
-    <option name="LAST_COMMIT_MESSAGE" value="wait #5127 @1" />
+    <MESSAGE value="wait #5127" />
+    <option name="LAST_COMMIT_MESSAGE" value="wait #5127" />
   </component>
   <component name="XSLT-Support.FileAssociations.UIState">
     <expand />
index fbead28c85defff7524d1557b6b1aa61f5f9253c..d85cdf487a3c857f7115abb6afd383aa9e069ec6 100644 (file)
@@ -6,13 +6,18 @@ namespace App\Console\Commands;
 use App\Models\Company;
 use App\Models\ELearningMedia;
 use App\Models\ELearningPackage;
+use App\Models\FluidbookCollection;
+use App\Models\FluidbookIconset;
 use App\Models\FluidbookQuote;
 use App\Models\FluidbookTheme;
+use App\Models\FluidbookTranslate;
 use App\Models\Quiz;
 use App\Models\AuthUser;
+use App\Models\Signature;
 use App\Models\User;
 use Cubedesigners\UserDatabase\Permissions;
 use Cubist\Backpack\Console\Commands\CubistCommand;
+use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel;
 
 class Precache extends CubistCommand
 {
@@ -28,6 +33,10 @@ class Precache extends CubistCommand
             'Cache permissions data' => 'permissions',
             'Cache fluidbook quote data' => 'class:' . FluidbookQuote::class,
             'Cache fluidbook theme data' => 'class:' . FluidbookTheme::class,
+            'Cache fluidbook icon set data' => 'class:' . FluidbookIconset::class,
+            'Cache fluidbook signature data' => 'class:' . Signature::class,
+            'Cache fluidbook collection data' => 'class:' . FluidbookCollection::class,
+            'Cache fluidbook translation data' => 'class:' . FluidbookTranslate::class,
             'Cache quiz data' => 'class:' . Quiz::class,
             'Cache elearning media data' => 'class:' . ELearningMedia::class,
             'Cache elearning package data' => 'class:' . ELearningPackage::class,
@@ -67,7 +76,9 @@ class Precache extends CubistCommand
     {
         $instances = $className::withoutGlobalScopes()->get();
         foreach ($instances as $instance) {
-            $instance->preCache();
+            if ($instance instanceof CubistMagicAbstractModel) {
+                $instance->preCache();
+            }
             break;
         }
     }
index 7f3312a35414eb03a83112d13f790e9e39208d2c..db6f0f80c64918cc847879aeebca6d0000253076 100644 (file)
@@ -2,23 +2,21 @@
 
 namespace App\Fields;
 
-use Cubist\Backpack\CubistBackpackServiceProvider;
 use Cubist\Backpack\Magic\Fields\SelectFromArray;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\DB;
 
 class FluidbookID extends SelectFromArray
 {
-    protected $_ajax = true;
-
     public function getOptions()
     {
-        if (backpack_user()) {
-            return Cache::remember('fluidbok_id_' . backpack_user()->id, 360, function () {
+        $u = backpack_user();
+        if ($u) {
+            return Cache::remember('fluidbok_id_' . $u->id, 600, function () use ($u) {
                 $res = [];
                 $q = DB::table('extranet_clean.books');
-                if (!backpack_user()->hasPermissionTo('fluidbook-publication:admin')) {
-                    $q->whereIn('proprietaire', explode(',', backpack_user()->e1_ws_rights));
+                if (!$u->hasPermissionTo('fluidbook-publication:admin')) {
+                    $q->whereIn('proprietaire', explode(',', $u->e1_ws_rights));
                 }
                 foreach ($q->orderByDesc('book_id')->get() as $book) {
                     $res[$book->book_id] = $book->book_id . ' - ' . $book->nom;