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

@@ -379,6 +379,10 @@ $this->addBreadcrumb($this->getTitle());
<?= $form->field($model, 'option_check_by_default_prevent_user_credit')
->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)): ?>
<h4>Paiement en ligne</h4>
<?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?>

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

@@ -0,0 +1,26 @@
<?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

@@ -259,7 +259,8 @@ class Producer extends ActiveRecordCommon
'option_main_color',
'option_newsletter_description',
'option_leave_period_message_title',
'option_leave_period_message'
'option_leave_period_message',
'option_credit_description',
],
'string'
],
@@ -540,6 +541,7 @@ class Producer extends ActiveRecordCommon
'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' => 'Message des congés',
'option_credit_description' => "Description Cagnotte",
];
}


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

@@ -39,8 +39,10 @@
use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule;
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();
$featureChecker = FeatureModule::getInstance()->getChecker();
$producer = $this->context->getProducerCurrent();
@@ -56,9 +58,17 @@ if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context-
]
);
}

?>

<?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">
<?= GridView::widget([
'summary' => '',

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

@@ -66,8 +66,8 @@ else {
?>
<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): ?>
<?= nl2br(Html::encode($producer->option_newsletter_description)); ?>
<?php else: ?>

Loading…
Cancel
Save