Browse Source

[Boutique] Cagnotte : texte d'information personnalisable

feature/rotating_product
Guillaume Bourgeois 5 months ago
parent
commit
ca8bae70c0
5 changed files with 47 additions and 5 deletions
  1. +4
    -0
      backend/views/producer/update.php
  2. +26
    -0
      console/migrations/m240530_080239_add_column_producer_option_credit_description.php
  3. +3
    -1
      domain/Producer/Producer/Producer.php
  4. +12
    -2
      producer/views/credit/history.php
  5. +2
    -2
      producer/views/newsletter/index.php

+ 4
- 0
backend/views/producer/update.php View File

<?= $form->field($model, 'option_check_by_default_prevent_user_credit') <?= $form->field($model, 'option_check_by_default_prevent_user_credit')
->dropDownList(Dropdown::noYesChoices()); ?> ->dropDownList(Dropdown::noYesChoices()); ?>


<?= $form->field($model, 'option_credit_description')
->hint('Description affichée sur la page "Cagnotte" de la boutique')
->textarea(); ?>

<?php if($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT)): ?> <?php if($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT)): ?>
<h4>Paiement en ligne</h4> <h4>Paiement en ligne</h4>
<?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?> <?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?>

+ 26
- 0
console/migrations/m240530_080239_add_column_producer_option_credit_description.php View File

<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m240530_080239_add_column_producer_option_credit_description
*/
class m240530_080239_add_column_producer_option_credit_description extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('producer', 'option_credit_description', Schema::TYPE_TEXT);
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('producer', 'option_credit_description');
}
}

+ 3
- 1
domain/Producer/Producer/Producer.php View File

'option_main_color', 'option_main_color',
'option_newsletter_description', 'option_newsletter_description',
'option_leave_period_message_title', 'option_leave_period_message_title',
'option_leave_period_message'
'option_leave_period_message',
'option_credit_description',
], ],
'string' 'string'
], ],
'option_leave_period_message_display' => 'Afficher le message des congés', 'option_leave_period_message_display' => 'Afficher le message des congés',
'option_leave_period_message_title' => 'Titre du message des congés', 'option_leave_period_message_title' => 'Titre du message des congés',
'option_leave_period_message' => 'Message des congés', 'option_leave_period_message' => 'Message des congés',
'option_credit_description' => "Description Cagnotte",
]; ];
} }



+ 12
- 2
producer/views/credit/history.php View File

use domain\Feature\Feature\Feature; use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule; use domain\Feature\Feature\FeatureModule;
use domain\Payment\PaymentModule; use domain\Payment\PaymentModule;
use yii\grid\GridView;
use domain\Producer\Producer\ProducerModule;use yii\grid\GridView;
use yii\helpers\Html;


$producerModule = ProducerModule::getInstance();
$paymentManager = PaymentModule::getInstance(); $paymentManager = PaymentModule::getInstance();
$featureChecker = FeatureModule::getInstance()->getChecker(); $featureChecker = FeatureModule::getInstance()->getChecker();
$producer = $this->context->getProducerCurrent(); $producer = $this->context->getProducerCurrent();
] ]
); );
} }

?> ?>


<?php
$creditDescription = $producerModule->getSolver()->getConfig('option_credit_description');
if($creditDescription): ?>
<div class="alert alert-info">
<i class="bi bi-info-circle"></i>
<?= nl2br(Html::encode($creditDescription)); ?>
</div>
<?php endif; ?>

<div class="table-responsive"> <div class="table-responsive">
<?= GridView::widget([ <?= GridView::widget([
'summary' => '', 'summary' => '',

+ 2
- 2
producer/views/newsletter/index.php View File

?> ?>
<div class="newsletter-index"> <div class="newsletter-index">


<div class="alert alert-dark">
<i class="bi bi-info"></i>
<div class="alert alert-info">
<i class="bi bi-info-circle"></i>
<?php if($producer->option_newsletter_description): ?> <?php if($producer->option_newsletter_description): ?>
<?= nl2br(Html::encode($producer->option_newsletter_description)); ?> <?= nl2br(Html::encode($producer->option_newsletter_description)); ?>
<?php else: ?> <?php else: ?>

Loading…
Cancel
Save