<h4>Groupes utilisateurs</h4> | <h4>Groupes utilisateurs</h4> | ||||
<?= $form->field($model, 'id_user_group_default') | <?= $form->field($model, 'id_user_group_default') | ||||
->dropDownList($userGroupModule->getRepository()->populateUserGroupDropdownList()); ?> | ->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> | ||||
</div> | </div> | ||||
<?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'); | |||||
} | |||||
} |
'tiller_refresh_token', | 'tiller_refresh_token', | ||||
'tiller_redirect_uri', | 'tiller_redirect_uri', | ||||
'tiller_store_id', | 'tiller_store_id', | ||||
'option_main_color' | |||||
'option_main_color', | |||||
'option_newsletter_description' | |||||
], | ], | ||||
'string' | 'string' | ||||
], | ], | ||||
'tiller_store_id' => 'Tiller : store ID', | 'tiller_store_id' => 'Tiller : store ID', | ||||
'is_new' => 'Nouveau', | 'is_new' => 'Nouveau', | ||||
'agree_contact_about_software_development' => "J'accepte d'être contacté dans le cadre de l'amélioration du logiciel", | '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' | |||||
]; | ]; | ||||
} | } | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$userModule = UserModule::getInstance(); | $userModule = UserModule::getInstance(); | ||||
$producer = $this->context->getProducerCurrent(); | |||||
$this->setTitle("Infolettre"); | $this->setTitle("Infolettre"); | ||||
if($userModule->isUserSubscribedNewsletter($user)) { | if($userModule->isUserSubscribedNewsletter($user)) { | ||||
?> | ?> | ||||
<div class="newsletter-index"> | <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)): ?> | <?php if($userModule->isUserSubscribedNewsletter($user)): ?> | ||||
<div class="alert alert-success"> | <div class="alert alert-success"> | ||||
<i class="bi bi-megaphone"></i> | <i class="bi bi-megaphone"></i> | ||||
Vous n'êtes pas inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>. | Vous n'êtes pas inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>. | ||||
</div> | </div> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</div> | |||||
</div> |