]> _ Git - fluidbook-toolbox.git/commitdiff
wip #3753 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Dec 2020 10:27:50 +0000 (11:27 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Dec 2020 10:27:50 +0000 (11:27 +0100)
13 files changed:
app/Console/Commands/Precache.php [new file with mode: 0644]
app/Console/Commands/WorkshopMigration.php
app/Console/Kernel.php
app/Models/Company.php
app/Models/FluidbookQuote.php
app/Models/User.php
composer.lock
config/backpack/crud.php
config/debugbar.php [new file with mode: 0644]
public/packages/fluidbook/toolbox/css/style.less
resources/views/vendor/backpack/base/inc/sidebar_content.blade.php
resources/views/vendor/backpack/base/layouts/top_left.blade.php [new file with mode: 0644]
resources/views/vendor/backpack/crud/inc/form_save_buttons.blade.php [new file with mode: 0644]

diff --git a/app/Console/Commands/Precache.php b/app/Console/Commands/Precache.php
new file mode 100644 (file)
index 0000000..e82180f
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+
+
+namespace App\Console\Commands;
+
+use App\Models\Company;
+use App\Models\FluidbookQuote;
+use App\Models\Quiz;
+use App\Models\AuthUser;
+use App\Models\User;
+use Cubedesigners\UserDatabase\Permissions;
+use Cubist\Backpack\Console\Commands\CubistCommand;
+
+class Precache extends CubistCommand
+{
+    protected $signature = 'ws:precache';
+    protected $description = 'Pre calculate heavy caches';
+    protected static $_admin = 5;
+
+    public function handle()
+    {
+        $actions = [
+            'Cache user data' => 'user',
+            'Cache company data' => 'company',
+            'Cache permissions data' => 'permissions',
+            'Cache fluidbook quote data' => 'fluidbookquote',
+            'Cache quiz data' => 'quiz',
+        ];
+
+        $user = AuthUser::where('id', self::$_admin)->first();
+        backpack_auth()->login($user);
+
+        $this->progressBar = $this->output->createProgressBar(count($actions));
+
+        $this->line('Begins data caching');
+        $this->progressBar->start();
+
+
+        foreach ($actions as $comment => $action) {
+            $this->line($comment);
+            $this->$action();
+            $this->progressBar->advance();
+        }
+
+        $this->line('End of caching data');
+    }
+
+    protected function permissions()
+    {
+        Permissions::getManagedUsers(5);
+    }
+
+    protected function company()
+    {
+        $companies = Company::withoutGlobalScopes()->get();
+        foreach ($companies as $company) {
+            $company->preCache();
+            break;
+        }
+    }
+
+    protected function user()
+    {
+        $users = User::withoutGlobalScopes()->get();
+        foreach ($users as $user) {
+            $user->preCache();
+            break;
+        }
+    }
+
+    protected function fluidbookquote()
+    {
+        $quotes = FluidbookQuote::withoutGlobalScopes()->get();
+        foreach ($quotes as $quote) {
+            $quote->preCache();
+            break;
+        }
+    }
+
+    protected function quiz()
+    {
+        $quizzes = Quiz::withoutGlobalScopes()->get();
+        foreach ($quizzes as $quiz) {
+            $quiz->preCache();
+            break;
+        }
+    }
+
+}
index c3a4948a5ca840e65d99f9b69442f8d3944afde7..5c6b7e062c8931f7b04dda5f883d374bac9734ce 100644 (file)
@@ -56,28 +56,6 @@ class WorkshopMigration extends CubistCommand
         $this->executeProcessQuiet('php artisan optimize:clear');
     }
 
-//    protected function importSignatures()
-//    {
-//        $map = ['signature_id' => 'id',
-//            'nom' => 'name',
-//            'active' => 'active'];
-//
-//        Signature::query()->truncate();
-//        foreach (DB::table($this->_oldDB . '.signatures')->get() as $e) {
-//            $c = new Signature();
-//            foreach ($map as $old => $new) {
-//                $c->setAttribute($new, $e->$old);
-//            }
-//            $credits = '<a href="' . $e->fbcredit . '" target="_blank">' . $e->fblink . '</a>';
-//            if ($e->partnercredit !== '') {
-//                $credits = '<a href="' . $e->partnercredit . '" target="_blank">' . $e->partnerlink . '</a>' . $credits;
-//            }
-//            $c->setAttribute('credits', $credits);
-//            $c->save();
-//        }
-//
-//    }
-
     protected function importQuotes()
     {
         $map = ['demande_id' => 'id',
index b790bc50aa735839830e2996cf7e74380f6f6324..63d894f1ee8b8d9c7e34ebdfbb4b5132b4688048 100644 (file)
@@ -24,6 +24,8 @@ class Kernel extends ConsoleKernel
      */
     protected function schedule(Schedule $schedule)
     {
+        $schedule->command('ws:precache')->everyMinute();
+
         $schedule->command('backup:clean')->daily()->at('04:00');
         $schedule->command('backup:run')->daily()->at('05:00');
     }
index 8402220f6bbcc7985a704d73fd66d44abf13c641..37ee110ef515ad49c6f7da753fc2e4f0b9f908ad 100644 (file)
@@ -1,7 +1,11 @@
 <?php
 
 namespace App\Models;
-class Company extends \Cubedesigners\UserDatabase\Company
+class Company extends \Cubedesigners\UserDatabase\Models\Company
 {
     protected $_syncDbSchema = false;
+    protected $_options = ['name' => 'company',
+        'singular' => 'client',
+        'plural' => 'clients'];
+
 }
index 075a6b41f499ea8f4c4de68bae349320b9d313a0..08b95a9a012a7bc0b3ae7d6f863613097e46e126 100644 (file)
@@ -8,8 +8,6 @@ use App\Http\Controllers\Admin\Operations\FluidbookQuote\AssignOperation;
 use App\Http\Controllers\Admin\Operations\FluidbookQuote\ConfirmAssignmentOperation;
 use App\Http\Controllers\Admin\Operations\FluidbookQuote\CreateFromWebsite;
 use App\Widgets;
-use Backpack\CRUD\app\Library\Widget;
-use Cubedesigners\UserDatabase\User;
 use Cubist\Backpack\Http\Controllers\Operations\ShowOperation;
 use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel;
 use Illuminate\Database\Eloquent\Builder;
@@ -21,7 +19,8 @@ class FluidbookQuote extends CubistMagicAbstractModel
         'singular' => 'demande de devis',
         'plural' => 'demandes de devis'];
 
-    protected $_operations = [/*ShowOperation::class,*/ AssignOperation::class, CreateFromWebsite::class, ConfirmAssignmentOperation::class];
+    protected $_operations = [/*ShowOperation::class,*/
+        AssignOperation::class, CreateFromWebsite::class, ConfirmAssignmentOperation::class];
     protected $_enableClone = false;
     protected $_enableCreation = false;
     protected $_enableBulk = false;
@@ -44,7 +43,9 @@ class FluidbookQuote extends CubistMagicAbstractModel
         $this->addField('langs', 'Hidden');
 
         $this->addField('user', 'SelectFromModel', __('Utilisateur'),
-            ['optionsmodel' => User::class,
+            [
+                'optionsmodel' => User::class,
+                'optionsmodel_global_scopes' => false,
                 'attribute' => 'companyWithName',
                 'column_attribute' => 'CompanyWithNameOnTwoLines',
                 'column' => true,
@@ -97,7 +98,7 @@ class FluidbookQuote extends CubistMagicAbstractModel
             4 => __('Déjà client'),
         ], 'column' => true, 'filter' => true]);
 
-        $this->addField('notes', 'Textarea', __('Notes'),['column'=>true]);
+        $this->addField('notes', 'Textarea', __('Notes'), ['column' => true]);
 
         $this->addField('origin_column', FluidbookQuoteOrigin::class, __('Origine'), ['column' => true, 'filter' => true]);
         $this->addField('fluidbooks', 'ModelAttribute', __('Fluidbooks'), ['column' => true, 'column_label' => '<img width="20" src="/images/icons/icon-fluidbook.svg">', 'attribute' => 'user.e1_ws_count']);
index f06cb77eafb0912d5fc063818c67736c8002179d..ed2254f570398ecd9925cafc5b2f985f6737ccfa 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace App\Models;
 
-class User extends \Cubedesigners\UserDatabase\User
+class User extends \Cubedesigners\UserDatabase\Models\User
 {
     protected $_syncDbSchema = false;
 
index 5847d007c310803c53c0fdd9b565c9074211a919..7b202e40cd956450ae37b533afa301aaeaba7a97 100644 (file)
         },
         {
             "name": "cache/adapter-common",
-            "version": "1.1.0",
+            "version": "1.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/php-cache/adapter-common.git",
-                "reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32"
+                "reference": "6b87c5cbdf03be42437b595dbe5de8e97cd1d497"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/6320bb5f5574cb88438059b59f8708da6b6f1d32",
-                "reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32",
+                "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/6b87c5cbdf03be42437b595dbe5de8e97cd1d497",
+                "reference": "6b87c5cbdf03be42437b595dbe5de8e97cd1d497",
                 "shasum": ""
             },
             "require": {
                 "cache/tag-interop": "^1.0",
-                "php": "^5.6 || ^7.0",
+                "php": "^5.6 || ^7.0 || ^8.0",
                 "psr/cache": "^1.0",
                 "psr/log": "^1.0",
                 "psr/simple-cache": "^1.0"
                 {
                     "name": "Tobias Nyholm",
                     "email": "tobias.nyholm@gmail.com",
-                    "homepage": "https://github.com/Nyholm"
+                    "homepage": "https://github.com/nyholm"
                 }
             ],
             "description": "Common classes for PSR-6 adapters",
                 "tag"
             ],
             "support": {
-                "source": "https://github.com/php-cache/adapter-common/tree/master"
+                "source": "https://github.com/php-cache/adapter-common/tree/1.2.0"
             },
-            "time": "2018-07-08T13:04:33+00:00"
+            "time": "2020-12-14T12:17:39+00:00"
         },
         {
             "name": "cache/filesystem-adapter",
-            "version": "1.0.0",
+            "version": "1.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/php-cache/filesystem-adapter.git",
-                "reference": "d50680b6dabbe39f9831f5fc9efa61c09d936017"
+                "reference": "1501ca71502f45114844824209e6a41d87afb221"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-cache/filesystem-adapter/zipball/d50680b6dabbe39f9831f5fc9efa61c09d936017",
-                "reference": "d50680b6dabbe39f9831f5fc9efa61c09d936017",
+                "url": "https://api.github.com/repos/php-cache/filesystem-adapter/zipball/1501ca71502f45114844824209e6a41d87afb221",
+                "reference": "1501ca71502f45114844824209e6a41d87afb221",
                 "shasum": ""
             },
             "require": {
                 "cache/adapter-common": "^1.0",
                 "league/flysystem": "^1.0",
-                "php": "^5.6 || ^7.0",
+                "php": "^5.6 || ^7.0 || ^8.0",
                 "psr/cache": "^1.0",
                 "psr/simple-cache": "^1.0"
             },
             "provide": {
-                "psr/cache-implementation": "^1.0"
+                "psr/cache-implementation": "^1.0",
+                "psr/simple-cache-implementation": "^1.0"
             },
             "require-dev": {
                 "cache/integration-tests": "^0.16",
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.0-dev"
+                    "dev-master": "1.1-dev"
                 }
             },
             "autoload": {
                 {
                     "name": "Tobias Nyholm",
                     "email": "tobias.nyholm@gmail.com",
-                    "homepage": "https://github.com/Nyholm"
+                    "homepage": "https://github.com/nyholm"
                 }
             ],
             "description": "A PSR-6 cache implementation using filesystem. This implementation supports tags",
                 "tag"
             ],
             "support": {
-                "source": "https://github.com/php-cache/filesystem-adapter/tree/master"
+                "source": "https://github.com/php-cache/filesystem-adapter/tree/1.1.0"
             },
-            "time": "2017-07-16T21:09:25+00:00"
+            "time": "2020-12-14T12:17:39+00:00"
         },
         {
             "name": "cache/hierarchical-cache",
-            "version": "1.0.0",
+            "version": "1.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/php-cache/hierarchical-cache.git",
-                "reference": "97173a5115765f72ccdc90dbc01132a3786ef5fd"
+                "reference": "ba3746c65461b17154fb855068403670fd7fa2d3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-cache/hierarchical-cache/zipball/97173a5115765f72ccdc90dbc01132a3786ef5fd",
-                "reference": "97173a5115765f72ccdc90dbc01132a3786ef5fd",
+                "url": "https://api.github.com/repos/php-cache/hierarchical-cache/zipball/ba3746c65461b17154fb855068403670fd7fa2d3",
+                "reference": "ba3746c65461b17154fb855068403670fd7fa2d3",
                 "shasum": ""
             },
             "require": {
                 "cache/adapter-common": "^1.0",
-                "php": "^5.6 || ^7.0",
+                "php": "^5.6 || ^7.0 || ^8.0",
                 "psr/cache": "^1.0"
             },
             "require-dev": {
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.0-dev"
+                    "dev-master": "1.1-dev"
                 }
             },
             "autoload": {
                 {
                     "name": "Tobias Nyholm",
                     "email": "tobias.nyholm@gmail.com",
-                    "homepage": "https://github.com/Nyholm"
+                    "homepage": "https://github.com/nyholm"
                 }
             ],
             "description": "A helper trait and interface to your PSR-6 cache to support hierarchical keys.",
                 "psr-6"
             ],
             "support": {
-                "source": "https://github.com/php-cache/hierarchical-cache/tree/master"
+                "source": "https://github.com/php-cache/hierarchical-cache/tree/1.1.0"
             },
-            "time": "2017-07-16T21:58:17+00:00"
+            "time": "2020-12-14T12:17:39+00:00"
         },
         {
             "name": "cache/tag-interop",
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubedesigners_userdatabase.git",
-                "reference": "dca252aac1c06bc61a54cf3fde4a61a4034d8c8a"
+                "reference": "82d9104d3a0666d3f067032fa0dcda126aeb919c"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubedesigners/userdatabase/cubedesigners-userdatabase-dev-master-a37e90.tar",
-                "reference": "dca252aac1c06bc61a54cf3fde4a61a4034d8c8a",
-                "shasum": "6235517745e6dd115dc0572171fe1f21ccb07530"
+                "url": "https://composer.cubedesigners.com/dist/cubedesigners/userdatabase/cubedesigners-userdatabase-dev-master-33d8b9.tar",
+                "reference": "82d9104d3a0666d3f067032fa0dcda126aeb919c",
+                "shasum": "e73f4d84eb08f207dacfef2e2d41e701c6afb48a"
             },
             "require": {
                 "cubist/cms-back": "dev-master"
             },
             "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0-dev"
+                },
+                "laravel": {
+                    "providers": [
+                        "Cubedesigners\\UserDatabase\\CubedesignersUserDatabaseServiceProvider"
+                    ]
+                }
+            },
             "autoload": {
                 "psr-4": {
-                    "Cubedesigners\\UserDatabase\\": "src"
+                    "Cubedesigners\\UserDatabase\\": "src/app"
                 }
             },
             "license": [
                 }
             ],
             "description": "Cubedesigners common users database",
-            "time": "2020-12-09T07:05:00+00:00"
+            "time": "2020-12-15T20:25:51+00:00"
         },
         {
             "name": "cubist/cms-back",
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_cms-back.git",
-                "reference": "9833ca5f7ecedeecdd5f8c9062a3f2690386156e"
+                "reference": "83e296653f0cf4d2cc5cf33518c86d3deb9a618b"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-93ea0b.tar",
-                "reference": "9833ca5f7ecedeecdd5f8c9062a3f2690386156e",
-                "shasum": "0cfb6cae6a3bab6659abf087f9201e3fdb3c43b7"
+                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-dd75cc.tar",
+                "reference": "83e296653f0cf4d2cc5cf33518c86d3deb9a618b",
+                "shasum": "89111dc9b83affb7a3f7e2091d9806adce8a4547"
             },
             "require": {
                 "backpack/backupmanager": "^2.0",
                 }
             ],
             "description": "Cubist Backpack extension",
-            "time": "2020-12-09T12:11:14+00:00"
+            "time": "2020-12-14T18:28:34+00:00"
         },
         {
             "name": "cubist/cms-front",
         },
         {
             "name": "lavary/laravel-menu",
-            "version": "v1.7.7",
+            "version": "v1.8.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/lavary/laravel-menu.git",
-                "reference": "5592778b3193ae561614ecb107467469b694ab11"
+                "reference": "02c58d8284c47a33eb365873a02953bff8c95d31"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/lavary/laravel-menu/zipball/5592778b3193ae561614ecb107467469b694ab11",
-                "reference": "5592778b3193ae561614ecb107467469b694ab11",
+                "url": "https://api.github.com/repos/lavary/laravel-menu/zipball/02c58d8284c47a33eb365873a02953bff8c95d31",
+                "reference": "02c58d8284c47a33eb365873a02953bff8c95d31",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/lavary/laravel-menu/issues",
-                "source": "https://github.com/lavary/laravel-menu/tree/master"
+                "source": "https://github.com/lavary/laravel-menu/tree/v1.8.0"
             },
-            "time": "2019-09-06T16:28:16+00:00"
+            "time": "2020-12-12T18:16:03+00:00"
         },
         {
             "name": "league/commonmark",
         },
         {
             "name": "league/csv",
-            "version": "9.6.1",
+            "version": "9.6.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/thephpleague/csv.git",
-                "reference": "634322df4aed210fdfbb7c94e434dc860da733d9"
+                "reference": "f28da6e483bf979bac10e2add384c90ae9983e4e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/thephpleague/csv/zipball/634322df4aed210fdfbb7c94e434dc860da733d9",
-                "reference": "634322df4aed210fdfbb7c94e434dc860da733d9",
+                "url": "https://api.github.com/repos/thephpleague/csv/zipball/f28da6e483bf979bac10e2add384c90ae9983e4e",
+                "reference": "f28da6e483bf979bac10e2add384c90ae9983e4e",
                 "shasum": ""
             },
             "require": {
                 "ext-json": "*",
                 "ext-mbstring": "*",
-                "php": "^7.2.5"
+                "php": ">=7.2.5"
             },
             "require-dev": {
                 "ext-curl": "*",
                     "type": "github"
                 }
             ],
-            "time": "2020-09-05T08:40:12+00:00"
+            "time": "2020-12-10T19:40:30+00:00"
         },
         {
             "name": "league/flysystem",
         },
         {
             "name": "monolog/monolog",
-            "version": "2.1.1",
+            "version": "2.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Seldaek/monolog.git",
-                "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5"
+                "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9eee5cec93dfb313a38b6b288741e84e53f02d5",
-                "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5",
+                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084",
+                "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084",
                 "shasum": ""
             },
             "require": {
             "require-dev": {
                 "aws/aws-sdk-php": "^2.4.9 || ^3.0",
                 "doctrine/couchdb": "~1.0@dev",
-                "elasticsearch/elasticsearch": "^6.0",
+                "elasticsearch/elasticsearch": "^7",
                 "graylog2/gelf-php": "^1.4.2",
+                "mongodb/mongodb": "^1.8",
                 "php-amqplib/php-amqplib": "~2.4",
                 "php-console/php-console": "^3.1.3",
-                "php-parallel-lint/php-parallel-lint": "^1.0",
                 "phpspec/prophecy": "^1.6.1",
+                "phpstan/phpstan": "^0.12.59",
                 "phpunit/phpunit": "^8.5",
                 "predis/predis": "^1.1",
                 "rollbar/rollbar": "^1.3",
-                "ruflin/elastica": ">=0.90 <3.0",
+                "ruflin/elastica": ">=0.90 <7.0.1",
                 "swiftmailer/swiftmailer": "^5.3|^6.0"
             },
             "suggest": {
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "2.x-dev"
+                    "dev-main": "2.x-dev"
                 }
             },
             "autoload": {
                 {
                     "name": "Jordi Boggiano",
                     "email": "j.boggiano@seld.be",
-                    "homepage": "http://seld.be"
+                    "homepage": "https://seld.be"
                 }
             ],
             "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
-            "homepage": "http://github.com/Seldaek/monolog",
+            "homepage": "https://github.com/Seldaek/monolog",
             "keywords": [
                 "log",
                 "logging",
             ],
             "support": {
                 "issues": "https://github.com/Seldaek/monolog/issues",
-                "source": "https://github.com/Seldaek/monolog/tree/2.1.1"
+                "source": "https://github.com/Seldaek/monolog/tree/2.2.0"
             },
             "funding": [
                 {
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-07-23T08:41:23+00:00"
+            "time": "2020-12-14T13:15:25+00:00"
         },
         {
             "name": "myclabs/php-enum",
         },
         {
             "name": "spatie/laravel-backup",
-            "version": "6.13.1",
+            "version": "6.14.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/spatie/laravel-backup.git",
-                "reference": "a0ca6662fbc3d008fe9e17b0f74101d139aca6f1"
+                "reference": "982d8377816eaceac0ac0a78fbf9b0f75fb009db"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/a0ca6662fbc3d008fe9e17b0f74101d139aca6f1",
-                "reference": "a0ca6662fbc3d008fe9e17b0f74101d139aca6f1",
+                "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/982d8377816eaceac0ac0a78fbf9b0f75fb009db",
+                "reference": "982d8377816eaceac0ac0a78fbf9b0f75fb009db",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/spatie/laravel-backup/issues",
-                "source": "https://github.com/spatie/laravel-backup/tree/6.13.1"
+                "source": "https://github.com/spatie/laravel-backup/tree/6.14.0"
             },
             "funding": [
                 {
                     "type": "other"
                 }
             ],
-            "time": "2020-12-01T07:29:53+00:00"
+            "time": "2020-12-09T20:35:29+00:00"
         },
         {
             "name": "spatie/laravel-googletagmanager",
         },
         {
             "name": "facade/ignition",
-            "version": "2.5.2",
+            "version": "2.5.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/facade/ignition.git",
-                "reference": "08668034beb185fa2ac6f09b1034eaa440952ace"
+                "reference": "d8dc4f90ed469f9f9313b976fb078c20585d5c99"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/facade/ignition/zipball/08668034beb185fa2ac6f09b1034eaa440952ace",
-                "reference": "08668034beb185fa2ac6f09b1034eaa440952ace",
+                "url": "https://api.github.com/repos/facade/ignition/zipball/d8dc4f90ed469f9f9313b976fb078c20585d5c99",
+                "reference": "d8dc4f90ed469f9f9313b976fb078c20585d5c99",
                 "shasum": ""
             },
             "require": {
                 "issues": "https://github.com/facade/ignition/issues",
                 "source": "https://github.com/facade/ignition"
             },
-            "time": "2020-11-17T09:18:51+00:00"
+            "time": "2020-12-09T20:25:45+00:00"
         },
         {
             "name": "facade/ignition-contracts",
         },
         {
             "name": "fzaninotto/faker",
-            "version": "v1.9.1",
+            "version": "v1.9.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/fzaninotto/Faker.git",
-                "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f"
+                "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f",
-                "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f",
+                "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e",
+                "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/fzaninotto/Faker/issues",
-                "source": "https://github.com/fzaninotto/Faker/tree/v1.9.1"
+                "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2"
             },
             "abandoned": true,
-            "time": "2019-12-12T13:22:17+00:00"
+            "time": "2020-12-11T09:56:16+00:00"
         },
         {
             "name": "hamcrest/hamcrest-php",
         },
         {
             "name": "phar-io/version",
-            "version": "3.0.3",
+            "version": "3.0.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phar-io/version.git",
-                "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae"
+                "reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae",
-                "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae",
+                "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
+                "reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
                 "shasum": ""
             },
             "require": {
             "description": "Library for handling version information and constraints",
             "support": {
                 "issues": "https://github.com/phar-io/version/issues",
-                "source": "https://github.com/phar-io/version/tree/3.0.3"
+                "source": "https://github.com/phar-io/version/tree/3.0.4"
             },
-            "time": "2020-11-30T09:21:21+00:00"
+            "time": "2020-12-13T23:18:30+00:00"
         },
         {
             "name": "phpdocumentor/reflection-common",
index d544593a674a36bb82adeeb07b9de320cc0b5ccf..849b140b758d9f579ae150b66e4b1e668c3af39a 100644 (file)
@@ -39,7 +39,7 @@ return [
             // How many items should be shown by default by the Datatable?
             // This value can be overwritten on a specific CRUD by calling
             // $this->crud->setDefaultPageLength(50);
-            'defaultPageLength' => 100,
+            'defaultPageLength' => 25,
 
             // A 1D array of options which will be used for both the displayed option and the value, or
             // A 2D array in which the first array is used to define the value options and the second array the displayed options
diff --git a/config/debugbar.php b/config/debugbar.php
new file mode 100644 (file)
index 0000000..d17dde2
--- /dev/null
@@ -0,0 +1,216 @@
+<?php
+
+return [
+
+    /*
+     |--------------------------------------------------------------------------
+     | Debugbar Settings
+     |--------------------------------------------------------------------------
+     |
+     | Debugbar is enabled by default, when debug is set to true in app.php.
+     | You can override the value by setting enable to true or false instead of null.
+     |
+     | You can provide an array of URI's that must be ignored (eg. 'api/*')
+     |
+     */
+
+    'enabled' => env('DEBUGBAR_ENABLED', null),
+    'except' => [
+        'telescope*',
+        'horizon*',
+    ],
+
+    /*
+     |--------------------------------------------------------------------------
+     | Storage settings
+     |--------------------------------------------------------------------------
+     |
+     | DebugBar stores data for session/ajax requests.
+     | You can disable this, so the debugbar stores data in headers/session,
+     | but this can cause problems with large data collectors.
+     | By default, file storage (in the storage folder) is used. Redis and PDO
+     | can also be used. For PDO, run the package migrations first.
+     |
+     */
+    'storage' => [
+        'enabled'    => true,
+        'driver'     => 'file', // redis, file, pdo, custom
+        'path'       => storage_path('debugbar'), // For file driver
+        'connection' => null,   // Leave null for default connection (Redis/PDO)
+        'provider'   => '', // Instance of StorageInterface for custom driver
+    ],
+
+    /*
+     |--------------------------------------------------------------------------
+     | Vendors
+     |--------------------------------------------------------------------------
+     |
+     | Vendor files are included by default, but can be set to false.
+     | This can also be set to 'js' or 'css', to only include javascript or css vendor files.
+     | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
+     | and for js: jquery and and highlight.js
+     | So if you want syntax highlighting, set it to true.
+     | jQuery is set to not conflict with existing jQuery scripts.
+     |
+     */
+
+    'include_vendors' => true,
+
+    /*
+     |--------------------------------------------------------------------------
+     | Capture Ajax Requests
+     |--------------------------------------------------------------------------
+     |
+     | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
+     | you can use this option to disable sending the data through the headers.
+     |
+     | Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
+     */
+
+    'capture_ajax' => true,
+    'add_ajax_timing' => false,
+
+    /*
+     |--------------------------------------------------------------------------
+     | Custom Error Handler for Deprecated warnings
+     |--------------------------------------------------------------------------
+     |
+     | When enabled, the Debugbar shows deprecated warnings for Symfony components
+     | in the Messages tab.
+     |
+     */
+    'error_handler' => false,
+
+    /*
+     |--------------------------------------------------------------------------
+     | Clockwork integration
+     |--------------------------------------------------------------------------
+     |
+     | The Debugbar can emulate the Clockwork headers, so you can use the Chrome
+     | Extension, without the server-side code. It uses Debugbar collectors instead.
+     |
+     */
+    'clockwork' => false,
+
+    /*
+     |--------------------------------------------------------------------------
+     | DataCollectors
+     |--------------------------------------------------------------------------
+     |
+     | Enable/disable DataCollectors
+     |
+     */
+
+    'collectors' => [
+        'phpinfo'         => true,  // Php version
+        'messages'        => true,  // Messages
+        'time'            => true,  // Time Datalogger
+        'memory'          => true,  // Memory usage
+        'exceptions'      => true,  // Exception displayer
+        'log'             => true,  // Logs from Monolog (merged in messages if enabled)
+        'db'              => true,  // Show database (PDO) queries and bindings
+        'views'           => false,  // Views with their data
+        'route'           => true,  // Current route information
+        'auth'            => true, // Display Laravel authentication status
+        'gate'            => false,  // Display Laravel Gate checks
+        'session'         => true,  // Display session data
+        'symfony_request' => true,  // Only one can be enabled..
+        'mail'            => true,  // Catch mail messages
+        'laravel'         => true, // Laravel version and environment
+        'events'          => false, // All events fired
+        'default_request' => false, // Regular or special Symfony request logger
+        'logs'            => false, // Add the latest log messages
+        'files'           => false, // Show the included files
+        'config'          => false, // Display config settings
+        'cache'           => false, // Display cache events
+        'models'          => false,  // Display models
+        'livewire'        => true,  // Display Livewire (when available)
+    ],
+
+    /*
+     |--------------------------------------------------------------------------
+     | Extra options
+     |--------------------------------------------------------------------------
+     |
+     | Configure some DataCollectors
+     |
+     */
+
+    'options' => [
+        'auth' => [
+            'show_name' => true,   // Also show the users name/email in the debugbar
+        ],
+        'db' => [
+            'with_params'       => true,   // Render SQL with the parameters substituted
+            'backtrace'         => true,   // Use a backtrace to find the origin of the query in your files.
+            'backtrace_exclude_paths' => [],   // Paths to exclude from backtrace. (in addition to defaults)
+            'timeline'          => true,  // Add the queries to the timeline
+            'explain' => [                 // Show EXPLAIN output on queries
+                'enabled' => false,
+                'types' => ['SELECT'],     // Deprecated setting, is always only SELECT
+            ],
+            'hints'             => false,    // Show hints for common mistakes
+            'show_copy'         => false,    // Show copy button next to the query
+        ],
+        'mail' => [
+            'full_log' => false,
+        ],
+        'views' => [
+            'data' => false,    //Note: Can slow down the application, because the data can be quite large..
+        ],
+        'route' => [
+            'label' => true,  // show complete route on bar
+        ],
+        'logs' => [
+            'file' => null,
+        ],
+        'cache' => [
+            'values' => true, // collect cache values
+        ],
+    ],
+
+    /*
+     |--------------------------------------------------------------------------
+     | Inject Debugbar in Response
+     |--------------------------------------------------------------------------
+     |
+     | Usually, the debugbar is added just before </body>, by listening to the
+     | Response after the App is done. If you disable this, you have to add them
+     | in your template yourself. See http://phpdebugbar.com/docs/rendering.html
+     |
+     */
+
+    'inject' => true,
+
+    /*
+     |--------------------------------------------------------------------------
+     | DebugBar route prefix
+     |--------------------------------------------------------------------------
+     |
+     | Sometimes you want to set route prefix to be used by DebugBar to load
+     | its resources from. Usually the need comes from misconfigured web server or
+     | from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
+     |
+     */
+    'route_prefix' => '_debugbar',
+
+    /*
+     |--------------------------------------------------------------------------
+     | DebugBar route domain
+     |--------------------------------------------------------------------------
+     |
+     | By default DebugBar route served from the same domain that request served.
+     | To override default domain, specify it as a non-empty value.
+     */
+    'route_domain' => null,
+
+    /*
+     |--------------------------------------------------------------------------
+     | DebugBar theme
+     |--------------------------------------------------------------------------
+     |
+     | Switches between light and dark theme. If set to auto it will respect system preferences
+     | Possible values: auto, light, dark
+     */
+    'theme' => 'auto',
+];
index 72641f926f4e7b46890d0f328a97da9b78a69d75..c1f3ab24ec2b37ef8d570c1f9bfdca03ac31726e 100644 (file)
@@ -315,3 +315,40 @@ a, a.btn-link {
         display: block !important;
     }
 }
+
+body.embeded {
+    .app-header, .app-body .sidebar-pills, .app-footer, main > section {
+        display: none;
+    }
+
+    main > div > .row > div {
+        max-width: 100%;
+        flex: none;
+    }
+}
+
+.company-userlist {
+    width: 100%;
+    padding: 0 1em;
+
+    table {
+        margin-top: 3.5em;
+        width: 100%;
+        text-align: left;
+
+        tr {
+            td {
+                padding: 0 1em;
+
+                &:first-child, &:last-child {
+                    white-space: nowrap;
+                    width: 1px;
+                }
+            }
+        }
+    }
+
+    .add {
+        float: right;
+    }
+}
index 3a82df3f379db94b3ab4e6cf67941e8f1e31cf66..506bc553c8b66266597ba59c49c135ab897ed833 100644 (file)
     <li class='nav-item nav-dropdown open'><a class='nav-link nav-dropdown-toggle' href='#'><i
                 class='nav-icon la la-group'></i>Clients</a>
         <ul class='nav-dropdown-items'>
-            @can('users:read')
-                <li class='nav-item'><a class='nav-link' href='{{ backpack_url('users') }}'><i
-                            class='nav-icon la la-user'></i><span>{{__('Utilisateurs')}}</span></a></li>
-            @endcan
             @can('company:read')
                 <li class='nav-item'><a class='nav-link' href='{{ backpack_url('company') }}'><i
                             class='nav-icon la la-building'></i>
-                        <span>{{__('Entreprises')}}</span></a></li>
+                        <span>{{__('Clients')}}</span></a></li>
             @endcan
             @can('managerolesandpersmissions')
                 <li class='nav-item'><a class='nav-link' href='{{ backpack_url('role') }}'><i
diff --git a/resources/views/vendor/backpack/base/layouts/top_left.blade.php b/resources/views/vendor/backpack/base/layouts/top_left.blade.php
new file mode 100644 (file)
index 0000000..da40ada
--- /dev/null
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+
+<html lang="{{ app()->getLocale() }}" dir="{{ config('backpack.base.html_direction') }}">
+
+<head>
+    @include(backpack_view('inc.head'))
+
+</head>
+
+<body class="{{ config('backpack.base.body_class').' '.(request()->get('embeded','0')==='0'?'':'embeded') }}">
+
+@include(backpack_view('inc.main_header'))
+
+<div class="app-body">
+
+    @include(backpack_view('inc.sidebar'))
+
+    <main class="main pt-2">
+
+        @yield('before_breadcrumbs_widgets')
+
+        @includeWhen(isset($breadcrumbs), backpack_view('inc.breadcrumbs'))
+
+        @yield('after_breadcrumbs_widgets')
+
+        @yield('header')
+
+        <div class="container-fluid animated fadeIn">
+
+            @yield('before_content_widgets')
+
+            @yield('content')
+
+            @yield('after_content_widgets')
+
+        </div>
+
+    </main>
+
+</div><!-- ./app-body -->
+
+<footer class="{{ config('backpack.base.footer_class') }}">
+    @include(backpack_view('inc.footer'))
+</footer>
+
+@yield('before_scripts')
+@stack('before_scripts')
+
+@include(backpack_view('inc.scripts'))
+
+@yield('after_scripts')
+@stack('after_scripts')
+</body>
+</html>
diff --git a/resources/views/vendor/backpack/crud/inc/form_save_buttons.blade.php b/resources/views/vendor/backpack/crud/inc/form_save_buttons.blade.php
new file mode 100644 (file)
index 0000000..96f5898
--- /dev/null
@@ -0,0 +1,68 @@
+@php
+    $embeded = $crud->isEmbeded();
+    if($embeded){
+        $saveAction['active']=['value'=>'save_and_back','label'=>__('Enregistrer et fermer')];
+        $saveAction['options']=[];
+    }
+@endphp
+@if(isset($saveAction['active']) && !is_null($saveAction['active']['value']))
+    <div id="saveActions" class="form-group">
+
+        <input type="hidden" name="save_action" value="{{ $saveAction['active']['value'] }}">
+        @if(!empty($saveAction['options']))
+            <div class="btn-group" role="group">
+                @endif
+
+                <button type="submit" class="btn btn-success">
+                    <span class="la la-save" role="presentation" aria-hidden="true"></span> &nbsp;
+                    <span data-value="{{ $saveAction['active']['value'] }}">{{ $saveAction['active']['label'] }}</span>
+                </button>
+
+                <div class="btn-group" role="group">
+                    @if(!empty($saveAction['options']))
+                        <button id="btnGroupDrop1" type="button" class="btn btn-success dropdown-toggle"
+                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span
+                                class="caret"></span><span class="sr-only">&#x25BC;</span></button>
+                        <div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
+                            @foreach( $saveAction['options'] as $value => $label)
+                                <a class="dropdown-item" href="javascript:void(0);"
+                                   data-value="{{ $value }}">{{ $label }}</a>
+                            @endforeach
+                        </div>
+
+                    @endif
+                </div>
+                @if(!empty($saveAction['options']))
+            </div>
+        @endif
+        @if(!$crud->hasOperationSetting('showCancelButton') || $crud->getOperationSetting('showCancelButton') == true)
+            <a href="{{ $crud->hasAccess('list') ? url($crud->route) : url()->previous() }}"
+               class="btn btn-default btn-form-cancel"><span class="la la-ban"></span>
+                &nbsp;{{ trans('backpack::crud.cancel') }}</a>
+        @endif
+    </div>
+@endif
+
+@if($embeded)
+    @push('after_scripts')
+        <script>
+            (function ($) {
+                $(function () {
+                    $(document).on('click', '.btn-form-cancel', function () {
+                        window.parent.jQuery.featherlight.current().close();
+                        return false;
+                    });
+
+                    $(document).on('click', 'button[type="submit"].btn-success', function () {
+                        $(window).on('unload', function () {
+                            window.parent.crud.table.ajax.reload();
+                            window.parent.jQuery.featherlight.current().close();
+                            return true;
+                        });
+                        return true;
+                    });
+                });
+            })(jQuery);
+        </script>
+    @endpush
+@endif