]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6717 @3:00
authorsoufiane <soufiane@cubedesigners.com>
Mon, 12 Feb 2024 14:49:00 +0000 (15:49 +0100)
committersoufiane <soufiane@cubedesigners.com>
Mon, 12 Feb 2024 14:49:00 +0000 (15:49 +0100)
app/Http/Controllers/Admin/Operations/FluidbookPublication/DownloadOperation.php
app/Mail/FluidbookQuoteReceived.php

index 2d5701bf8f25990e4ad15612209fab09408055f5..32e9fb43d2cedd950c067c59e715cfbe3031ff36 100644 (file)
@@ -21,6 +21,7 @@ trait DownloadOperation
         Route::match(['get'], $segment . '/{id}/package/{action}/{version}', $controller . '@package');
         Route::match(['get'], $segment . '/{id}/package/{action}/scorm/{scormversion}', $controller . '@packageScorm');
         Route::match(['get'], $segment . '/{id}_{hash}/download/{file}', $controller . '@download')->withoutMiddleware([CheckIfAdmin::class]);;
+        Route::match(['get','post'], $segment . '/download_settings/{file}', $controller . '@downloadSettings')->withoutMiddleware([CheckIfAdmin::class])->name("download_settings");
     }
 
     protected function setupDownloadDefaults()
@@ -126,4 +127,11 @@ trait DownloadOperation
         Alert::add('success', __('La compilation a été placée en file d\'attente. Vous recevrez un email lorsqu\'elle sera terminée.'))->flash();
         return back();
     }
+
+    protected function downloadSettings($file) {
+        $name = "settings_export";
+        $path = base64_decode($file);
+        if(!file_exists($path)) abort(404);
+        return response()->download($path, $name . '.xlsx')->deleteFileAfterSend(true);
+    }
 }
index c01a6860e7e649a2ea387b5bf20c0298a376a3d2..4cbc27a966b120510687de179d62189b7f11f092 100644 (file)
@@ -14,7 +14,6 @@ class FluidbookQuoteReceived extends Base
      */
     public function setData($post)
     {
-
         $this->replyTo($post['email'], $post['prenom'] . ' ' . $post['nom']);
         $this->from('tech@fluidbook.com');
         $this->to('tech@fluidbook.com');