]> _ Git - fluidbook-toolbox.git/commitdiff
wait #4952 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 13 Jun 2022 14:08:56 +0000 (16:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 13 Jun 2022 14:08:56 +0000 (16:08 +0200)
app/Models/FluidbookPublication.php
app/Models/Traits/PublicationSettings.php

index 1670dada4541523c90cbded97627d82b96168573..dfdd529a7e1a236e055389cd7e753b89deb053f0 100644 (file)
@@ -8,13 +8,11 @@ use App\Fields\FluidbookTitle;
 use App\Fields\User;
 use App\Models\Base\ToolboxModel;
 use App\Models\Traits\PublicationSettings;
-use App\SubForms\FluidbookTranslationOverwrite;
 use Cubist\Backpack\Magic\Fields\Datetime;
 use Cubist\Backpack\Magic\Fields\FormBigSection;
 use Cubist\Backpack\Magic\Fields\FormSuperSection;
 use Cubist\Backpack\Magic\Fields\Hidden;
 use Cubist\Backpack\Magic\Fields\Integer;
-use Cubist\Backpack\Magic\Fields\KeyValueBunchOfFieldsMultiple;
 use Cubist\Backpack\Magic\Fields\SelectFromArray;
 use Cubist\Backpack\Magic\Fields\Textarea;
 
@@ -143,4 +141,13 @@ class FluidbookPublication extends ToolboxModel
     {
         return '/data1/extranet/www/fluidbook/books/working/' . $this->id;
     }
+
+    public function getSCORMVersion()
+    {
+        if (!$this->scorm_enable) {
+            return '-';
+        }
+        $map = ['1.2' => '1.2', '2004' => '2004', '2004.3' => '2004 <sup>3rd ed.</sup>'];
+        return $map[$this->scorm_version];
+    }
 }
index 27ad4f8d39ca45c55c59905c1a1fbbe939289a55..c81245b60f0ea0f59785db07a424d93b28d9798f 100644 (file)
@@ -2131,7 +2131,7 @@ trait PublicationSettings
                 0 => '*.xml',
                 1 => '*.xlsx',
             ],
-            'destination'=>'commerce',
+            'destination' => 'commerce',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
@@ -2619,7 +2619,7 @@ trait PublicationSettings
                 0 => '*.xml',
                 0 => '*.xlsx',
             ],
-            'destination'=>'commerce',
+            'destination' => 'commerce',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
@@ -2627,7 +2627,7 @@ trait PublicationSettings
         $this->addField('basketImages', FilesOrURL::class, $this->__('Images des produits'), [
             'v2' => '{"type":"freefile","default":"","editable":true,"label":"\\u00a7!\\u00a7Images des produits!\\u00a7!","grade":3,"multiple":true,"dir":"commerce"}',
             'default' => '',
-            'destination'=>'commerce',
+            'destination' => 'commerce',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
@@ -2641,7 +2641,7 @@ trait PublicationSettings
                 1 => '*.jpeg',
                 2 => '*.png',
             ],
-            'destination'=>'commerce',
+            'destination' => 'commerce',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
@@ -2654,7 +2654,7 @@ trait PublicationSettings
                 1 => '*.jpeg',
                 2 => '*.png',
             ],
-            'destination'=>'commerce',
+            'destination' => 'commerce',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
@@ -3050,7 +3050,7 @@ L,index',
             'translatable' => false,
         ]);
 
-        $this->addField('section_elearning',FormSuperSection::class,__('E-Learning'));
+        $this->addField('section_elearning', FormSuperSection::class, __('E-Learning'));
         $this->addField('section_gamify', FormSection::class, $this->__('Gamification'));
         $this->addField('gamify_coins_pages', Textarea::class, $this->__('Attribuer des coins lors de la visite des pages'), [
             'v2' => '{"type":"textarea","default":"","editable":true,"label":"\\u00a7!\\u00a7Attribuer des coins lors de la visite des pages!\\u00a7!"}',
@@ -3078,6 +3078,11 @@ L,index',
             'fake' => true,
             'store_in' => 'settings',
             'translatable' => false,
+            'column' => true,
+            'column_label' => 'SCORM',
+            'column_type' => 'model_function',
+            'column_view_namespace' => 'crud::columns',
+            'column_function_name' => 'getSCORMVersion',
         ]);
         $this->addField('scorm_id', LongText::class, $this->__('Identifiant SCORM'), [
             'v2' => '{"type":"text","default":"","editable":true,"label":"\\u00a7!\\u00a7Identifiant SCORM!\\u00a7!","grade":5}',