From: Vincent Vanwaelscappel Date: Mon, 27 Jun 2022 15:55:42 +0000 (+0200) Subject: wip #5319 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2ca21d77f6abcd4cbc49cd558adac55a4c6eaf14;p=fluidbook-toolbox.git wip #5319 @0.25 --- diff --git a/app/Fields/SCORMVersion.php b/app/Fields/SCORMVersion.php new file mode 100644 index 000000000..716eff7ae --- /dev/null +++ b/app/Fields/SCORMVersion.php @@ -0,0 +1,29 @@ + __('SCORM 1.2'), + '2004.3' => __('SCORM 2004 3rd edition'), + 2004 => __('SCORM 2004 4th edition'), + ]; + } + + public function getDefaultAttributes() + { + return array_merge(parent::getDefaultAttributes(), ['column_label' => 'SCORM', + 'column_type' => 'model_function', + 'column_view_namespace' => 'crud::columns', + 'column_function_name' => 'getSCORMVersion']); + } +} diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index cf96f2907..8b7481f80 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -9,6 +9,7 @@ use App\Fields\FluidbookTitle; use App\Fields\User; use App\Models\Base\ToolboxModel; use App\Models\Traits\PublicationSettings; +use App\Models\Traits\SCORMVersionTrait; use Cubist\Backpack\Magic\Fields\Datetime; use Cubist\Backpack\Magic\Fields\FormBigSection; use Cubist\Backpack\Magic\Fields\FormSuperSection; @@ -29,6 +30,7 @@ class FluidbookPublication extends ToolboxModel protected static $_permissionBase = 'fluidbook-publication'; use PublicationSettings; + use SCORMVersionTrait; public function setFields() { @@ -143,12 +145,5 @@ 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 3rd ed.']; - return $map[$this->scorm_version]; - } + } diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php index 6ef32da29..a6ec1f91c 100644 --- a/app/Models/Quiz.php +++ b/app/Models/Quiz.php @@ -3,8 +3,10 @@ namespace App\Models; +use App\Fields\SCORMVersion; use App\Http\Controllers\Admin\Base\QuizController; use App\Models\Base\ToolboxModel; +use App\Models\Traits\SCORMVersionTrait; use Cubist\Util\Files\Files; use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\Image\Manipulations; @@ -25,6 +27,8 @@ class Quiz extends ToolboxModel public $registerMediaConversionsUsingModelInstance = false; + use SCORMVersionTrait; + protected static function _getColors() { return [ @@ -94,6 +98,13 @@ class Quiz extends ToolboxModel $this->addColumnDateFields(__('Projet')); $this->addOwnerField(__('Projet')); + $this->addField(['name' => 'scorm_version', + 'label' => __('Version SCORM'), + 'column' => true, + 'type' => SCORMVersion::class, + 'tab' => __('Projet')] + ); + $this->addField(['name' => 'title', 'label' => __('Titre du quiz'), 'type' => 'Text', diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index c81245b60..54d845bc7 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -4,6 +4,7 @@ namespace App\Models\Traits; use App\Fields\FluidbookDevelopmentVersion; use App\Fields\FluidbookSignature; +use App\Fields\SCORMVersion; use Cubist\Backpack\Magic\Fields\Checkbox; use Cubist\Backpack\Magic\Fields\FilesOrURL; use Cubist\Backpack\Magic\Fields\FormSection; @@ -3067,14 +3068,8 @@ L,index', 'store_in' => 'settings', 'translatable' => false, ]); - $this->addField('scorm_version', SelectFromArray::class, $this->__('Version du standard SCORM'), [ + $this->addField('scorm_version', SCORMVersion::class, $this->__('Version du standard SCORM'), [ 'v2' => '{"type":"combo","default":"1.2","editable":true,"label":"\\u00a7!\\u00a7Version du standard SCORM!\\u00a7!","grade":5,"datas":{"\\u00a7!\\u00a7SCORM 1.2!\\u00a7!":"1.2","\\u00a7!\\u00a7SCORM 2004 3rd edition!\\u00a7!":"2004.3","\\u00a7!\\u00a7SCORM 2004 4th edition!\\u00a7!":"2004"}}', - 'options' => [ - '1.2' => $this->__('SCORM 1.2'), - '2004.3' => $this->__('SCORM 2004 3rd edition'), - 2004 => $this->__('SCORM 2004 4th edition'), - ], - 'default' => '1.2', 'fake' => true, 'store_in' => 'settings', 'translatable' => false, diff --git a/app/Models/Traits/SCORMVersionTrait.php b/app/Models/Traits/SCORMVersionTrait.php new file mode 100644 index 000000000..4c1f60311 --- /dev/null +++ b/app/Models/Traits/SCORMVersionTrait.php @@ -0,0 +1,15 @@ +scorm_enable) || !$this->scorm_version) { + return '-'; + } + $map = ['1.2' => '1.2', '2004' => '2004', '2004.3' => '2004 3rd ed.']; + return $map[$this->scorm_version]; + } +} diff --git a/resources/emailconfig/spamassassin-rules.cf b/resources/emailconfig/spamassassin-rules.cf index a966f035b..73d4eb069 100644 --- a/resources/emailconfig/spamassassin-rules.cf +++ b/resources/emailconfig/spamassassin-rules.cf @@ -12,11 +12,11 @@ score BAYES_20 -2.0 score BAYES_30 -1.0 score BAYES_40 0.001 score BAYES_50 1.0 -score BAYES_60 3.1 -score BAYES_80 4.1 -score BAYES_95 5.1 -score BAYES_99 5.5 -score BAYES_999 7.5 +score BAYES_60 2.1 +score BAYES_80 3.1 +score BAYES_95 4.1 +score BAYES_99 4.5 +score BAYES_999 9.5 # TXRep @@ -34,8 +34,8 @@ loadplugin Mail::SpamAssassin::Plugin::TextCat ifplugin Mail::SpamAssassin::Plugin::TextCat ok_locales en ok_languages en es fr de sv it pt -score UNWANTED_LANGUAGE_BODY 1.25 -score CHARSET_FARAWAY 1.25 +score UNWANTED_LANGUAGE_BODY 3.0 +score CHARSET_FARAWAY 3.0 endif $spam_whitelist @@ -64,7 +64,7 @@ header __MIME_CONTENT_CYR Content-Type:raw =~ /charset=\"((((cs)?)koi8(-?)r)|(wi endif meta HDR_CYR __HDR_FROM_CYR || __HDR_TO_CYR || __HDR_SUBJECT_CYR || __MIME_CONTENT_CYR -score HDR_CYR 1.25 +score HDR_CYR 3.0 header __HDR_FROM_CYR_UTF8_CHARSET_DEFINITION From:raw =~ /=\?utf-8\?/i header __HDR_TO_CYR_UTF8_CHARSET_DEFINITION To:raw =~ /=\?utf-8\?/i @@ -73,23 +73,23 @@ header __HDR_TO_CYR_UTF8_CONTENT To =~ /(((\xD0[\x81\x90-\xBF])|(\xD1[\x80-\x8F\ meta __HDR_FROM_CYR_UTF8 __HDR_FROM_CYR_UTF8_CHARSET_DEFINITION && __HDR_FROM_CYR_UTF8_CONTENT meta __HDR_TO_CYR_UTF8 __HDR_TO_CYR_UTF8_CHARSET_DEFINITION && __HDR_TO_CYR_UTF8_CONTENT meta HDR_ADDR_CYR_UTF8 __HDR_FROM_CYR_UTF8 || __HDR_TO_CYR_UTF8 -score HDR_ADDR_CYR_UTF8 1.25 +score HDR_ADDR_CYR_UTF8 3.0 header __HRD_SENDER_RU From:addr =~ /@((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)$/i header __HRD_RECIPIENT_RU From:addr =~ /@((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)$/i header __HDR_ENVFROM_RU EnvelopeFrom:addr =~ /@((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)$/i header __HDR_RCVD_RU Received:raw =~ /from([[:blank:]]+((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)[[:blank:]])/i meta HDR_CCTLD_RU __HRD_SENDER_RU || __HRD_RECIPIENT_RU || __HDR_ENVFROM_RU || __HDR_RCVD_RU -score HDR_CCTLD_RU 1.25 +score HDR_CCTLD_RU 3.0 uri URI_IN_RU /^(http(s?)\:\/\/)((([a-zA-Z0-9])|\.|\-)+)\.ru(\.?)($|\/)/i -score URI_IN_RU 1.25 +score URI_IN_RU 3.0 ifplugin Mail::SpamAssassin::Plugin::MIMEHeader mimeheader __MIMEPART_NAME_RU Content-Type:raw =~ /name=\"=\?((((cs)?)koi8(-?)r)|(windows-1251))/ims mimeheader __MIME_FILENAME_RU Content-Disposition:raw =~ /filename=\"=\?((((cs)?)koi8(-?)r)|(windows-1251))/ims meta MIMEPART_NAME_RU __MIMEPART_NAME_RU || __MIME_FILENAME_RU -score MIMEPART_NAME_RU 1.25 +score MIMEPART_NAME_RU 3.0 endif # Note, that when examining body of a message, SA adds header to it as the @@ -104,4 +104,4 @@ endif meta __CONTENT_CYR_UTF8_CHARSET_DEFINITION __HDR_SUBJ_CYR_UTF8_CHARSET_DEFINITION || __HDR_CONTENTTYPE_CYR_UTF8_CHARSET_DEFINITION body __CONTENT_CYR_UTF8 /(((\xD0[\x81\x90-\xBF])|(\xD1[\x80-\x8F\x91]))([A-Za-z[:digit:][:blank:][:punct:]])?){3}/ meta CONTENT_CYR_UTF8 __CONTENT_CYR_UTF8_CHARSET_DEFINITION && __CONTENT_CYR_UTF8 -score CONTENT_CYR_UTF8 1.25 +score CONTENT_CYR_UTF8 3.0