]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6717 @0:25
authorsoufiane <soufiane@cubedesigners.com>
Wed, 14 Feb 2024 10:21:01 +0000 (11:21 +0100)
committersoufiane <soufiane@cubedesigners.com>
Wed, 14 Feb 2024 10:21:01 +0000 (11:21 +0100)
app/Console/Commands/FluidbookSettingsExport.php

index 61d8b9b956bed5678feeeac7f064ac37ec6cfa27..ca1f787cb782cd323eb732373ee3361df53656f0 100644 (file)
@@ -4,20 +4,16 @@ namespace App\Console\Commands;
 
 use App\Console\Commands\Base\ToolboxCommand;
 use App\Models\FluidbookPublication;
-use App\Models\Traits\PublicationSettings;
 use App\Models\User;
 use App\Notifications\ToolboxNotification;
-use App\SubForms\Link\Color;
 use Cubist\Util\ArrayUtil;
 use Cubist\Util\Files\Files;
-use Illuminate\Support\Facades\Mail;
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
 use PhpOffice\PhpSpreadsheet\Style\Alignment;
 use PhpOffice\PhpSpreadsheet\Style\Fill;
 use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
 use PhpOffice\PhpSpreadsheet\Style\Protection;
 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
-use App\Mail\Base;
 
 class FluidbookSettingsExport extends ToolboxCommand
 {
@@ -96,7 +92,13 @@ class FluidbookSettingsExport extends ToolboxCommand
             $style = $sheet->getStyleByColumnAndRow($c, $line);
             if(!$field[$key]['editable'] || $field[$key]['type'] === 'noteditable' || $field[$key]['type'] === 'hidden') {
                 $style->getProtection()->setLocked(Protection::PROTECTION_PROTECTED);
-                $style->getFill()->setFillType(Fill::FILL_SOLID)->getStartColor()->setARGB('dddddd');
+                $styleArray = [
+                    'fill' => [
+                        'fillType' => Fill::FILL_SOLID,
+                        'color' => ['argb' => 'dddddd'], // Couleur grise en format ARGB
+                    ],
+                ];
+                $style->applyFromArray($styleArray);
             }
             $style->getFont()->setBold(true);
             $style->getAlignment()->setVertical(Alignment::VERTICAL_CENTER);
@@ -112,7 +114,6 @@ class FluidbookSettingsExport extends ToolboxCommand
                     $value = is_array($value) ? json_encode($value) : $value;
                     $sheet->getCellByColumnAndRow($c, $line)->setValue($value);
                     $style = $sheet->getStyleByColumnAndRow($c, $line);
-
                     if(!$field[$key]['editable'] || $field[$key]['type'] === 'noteditable' || $field[$key]['type'] === 'hidden') {
                         $style->getProtection()->setLocked(Protection::PROTECTION_PROTECTED);
                         $style->getFill()->setFillType(Fill::FILL_SOLID)->getStartColor()->setARGB('dddddd');