@@ -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">×</span></a> |
@@ -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([ |
@@ -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' | |||
]; | |||
} | |||
@@ -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; | |||
} | |||
*/ | |||
} |