Просмотр исходного кода

[Administration] Développement : mise en avant des nouvelles versions et des informations de contact #656

refactoring
Guillaume Bourgeois 2 лет назад
Родитель
Сommit
38699dbba1
4 измененных файлов: 52 добавлений и 2 удалений
  1. +1
    -1
      backend/views/layouts/content.php
  2. +7
    -0
      backend/views/producer/update.php
  3. +3
    -1
      common/models/Producer.php
  4. +41
    -0
      console/migrations/m221109_100033_producer_add_option_display_message_new_opendistrib_version.php

+ 1
- 1
backend/views/layouts/content.php Просмотреть файл

@@ -77,7 +77,7 @@ use dmstr\widgets\Alert;
<section class="content">

<?php $producer = GlobalParam::getCurrentProducer(); ?>
<?php if(!$producer->isUpToDateWithOpendistribVersion()): ?>
<?php if(!$producer->isUpToDateWithOpendistribVersion() && $producer->option_display_message_new_opendistrib_version): ?>
<div class="alert alert-warning">
<p>Opendistrib a été mis à jour vers la version <?= GlobalParam::getOpendistribVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a></p>
<a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">&times;</span></a>

+ 7
- 0
backend/views/producer/update.php Просмотреть файл

@@ -72,6 +72,13 @@ $this->addBreadcrumb($this->getTitle());
<div>
<div v-show="currentSection == 'general'" class="panel panel-default">
<div class="panel-body">
<h4>Logiciel</h4>
<?= $form->field($model, 'option_display_message_new_opendistrib_version')
->dropDownList([
1 => 'Oui',
0 => 'Non'
], []); ?>

<h4>Accès</h4>
<?= $form->field($model, 'active')
->dropDownList([

+ 3
- 1
common/models/Producer.php Просмотреть файл

@@ -256,7 +256,8 @@ class Producer extends ActiveRecordCommon
'option_stripe_mode_test',
'option_notify_producer_order_summary',
'option_billing_reduction',
'option_export_evoliz'
'option_export_evoliz',
'option_display_message_new_opendistrib_version'
],
'boolean'
],
@@ -396,6 +397,7 @@ class Producer extends ActiveRecordCommon
'option_export_evoliz' => 'Activer l\'export vers Evoliz',
'latest_version_opendistrib' => 'Dernière version d\'Opendistrib',
'option_csv_separator' => 'Séparateur de colonnes (CSV)',
'option_display_message_new_opendistrib_version' => 'Afficher les messages de mise à jour du logiciel Opendistrib'
];
}


+ 41
- 0
console/migrations/m221109_100033_producer_add_option_display_message_new_opendistrib_version.php Просмотреть файл

@@ -0,0 +1,41 @@
<?php

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

/**
* Class m221109_100033_producer_add_option_display_message_new_opendistrib_version
*/
class m221109_100033_producer_add_option_display_message_new_opendistrib_version extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('producer', 'option_display_message_new_opendistrib_version', Schema::TYPE_BOOLEAN.' DEFAULT 1');
}

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

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m221109_100033_producer_add_option_display_message_new_opendistrib_version cannot be reverted.\n";

return false;
}
*/
}

Загрузка…
Отмена
Сохранить