]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6571 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 28 Dec 2023 18:17:22 +0000 (19:17 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 28 Dec 2023 18:17:22 +0000 (19:17 +0100)
app/Fields/FluidbookExtranetTask.php

index f65b0f77eac5a9cfbdacbbb775cb745ded732b2b..ab85d58f7ca813b33f745033285f003ffd100332 100644 (file)
@@ -15,9 +15,8 @@ class FluidbookExtranetTask extends SelectFromArray
 
     public function getOptions()
     {
-
         if (null === static::$_taskOptions) {
-            $_taskOptions = [];
+            static::$_taskOptions = [];
             if (null === static::$_projects) {
                 static::$_projects = static::_getProjects();
             }
@@ -29,11 +28,11 @@ class FluidbookExtranetTask extends SelectFromArray
                 if (!isset(static::$_projects[$project])) {
                     continue;
                 }
-                $t = [];
+                $p = static::$_projects[$project];
                 foreach ($tasks as $id => $task) {
-                    $t[$id] = $task->nom;
+                    static::$_taskOptions[$id] = $p->projet_id . ' | ' . $p->nom . ' > ' . $task->nom;
                 }
-                //   $res['project_' . $project] = ["text" => $projects[$project]->nom, 'children' => $t];
+
             }
         }
 
@@ -56,7 +55,7 @@ class FluidbookExtranetTask extends SelectFromArray
     {
         return Cache::remember('fluidbook_extranet_tasks', 360, function () {
             $tasks = [];
-            foreach (DB::connection('extranet')->table('taches')->orderBy('tache_id', 'ASC')->get()->all() as $task) {
+            foreach (DB::connection('extranet')->table('taches')->orderBy('projet', 'DESC')->orderBy('tache_id', 'ASC')->get()->all() as $task) {
                 if (!isset($tasks[$task->projet])) {
                     $tasks[$task->projet] = [];
                 }