@@ -144,6 +144,11 @@ $this->addBreadcrumb($this->getTitle()); | |||
<h4>Groupes utilisateurs</h4> | |||
<?= $form->field($model, 'id_user_group_default') | |||
->dropDownList($userGroupModule->getRepository()->populateUserGroupDropdownList()); ?> | |||
<h4>Communication</h4> | |||
<?= $form->field($model, 'option_newsletter_description') | |||
->hint('Description affichée sur la page "Infolettre" de la boutique') | |||
->textarea(); ?> | |||
</div> | |||
</div> | |||
@@ -0,0 +1,26 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
/** | |||
* Class m240513_092509_add_column_producer_option_newsletter_description | |||
*/ | |||
class m240513_092509_add_column_producer_option_newsletter_description extends Migration | |||
{ | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function safeUp() | |||
{ | |||
$this->addColumn('producer', 'option_newsletter_description', Schema::TYPE_TEXT); | |||
} | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function safeDown() | |||
{ | |||
$this->dropColumn('producer', 'option_newsletter_description'); | |||
} | |||
} |
@@ -256,7 +256,8 @@ class Producer extends ActiveRecordCommon | |||
'tiller_refresh_token', | |||
'tiller_redirect_uri', | |||
'tiller_store_id', | |||
'option_main_color' | |||
'option_main_color', | |||
'option_newsletter_description' | |||
], | |||
'string' | |||
], | |||
@@ -531,7 +532,8 @@ class Producer extends ActiveRecordCommon | |||
'tiller_store_id' => 'Tiller : store ID', | |||
'is_new' => 'Nouveau', | |||
'agree_contact_about_software_development' => "J'accepte d'être contacté dans le cadre de l'amélioration du logiciel", | |||
'option_main_color' => 'Couleur principale' | |||
'option_main_color' => 'Couleur principale', | |||
'option_newsletter_description' => 'Description infolettre' | |||
]; | |||
} | |||
@@ -40,7 +40,7 @@ use domain\User\User\UserModule; | |||
use yii\helpers\Html; | |||
$userModule = UserModule::getInstance(); | |||
$producer = $this->context->getProducerCurrent(); | |||
$this->setTitle("Infolettre"); | |||
if($userModule->isUserSubscribedNewsletter($user)) { | |||
@@ -65,6 +65,16 @@ else { | |||
?> | |||
<div class="newsletter-index"> | |||
<div class="alert alert-dark"> | |||
<i class="bi bi-info"></i> | |||
<?php if($producer->option_newsletter_description): ?> | |||
<?= nl2br(Html::encode($producer->option_newsletter_description)); ?> | |||
<?php else: ?> | |||
L'infolettre vous permet de recevoir les emails de prise de commande et les actualités de ce producteur. | |||
<?php endif; ?> | |||
</div> | |||
<?php if($userModule->isUserSubscribedNewsletter($user)): ?> | |||
<div class="alert alert-success"> | |||
<i class="bi bi-megaphone"></i> | |||
@@ -76,4 +86,4 @@ else { | |||
Vous n'êtes pas inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>. | |||
</div> | |||
<?php endif; ?> | |||
</div> | |||
</div> |