Selaa lähdekoodia

Gestion des champs mentions et gcs

dev
Guillaume Bourgeois 5 vuotta sitten
vanhempi
commit
4a28b6c119
4 muutettua tiedostoa jossa 41 lisäystä ja 2 poistoa
  1. +14
    -0
      backend/views/producer/update.php
  2. +4
    -0
      backend/web/js/vuejs/producer-update.js
  3. +6
    -2
      common/models/Producer.php
  4. +17
    -0
      console/migrations/m190204_151019_add_champs_infos_legales.php

+ 14
- 0
backend/views/producer/update.php Näytä tiedosto

@@ -185,6 +185,20 @@ $this->addBreadcrumb($this->getTitle()) ;
<?= $form->field($model, 'secret_key_payplug') ?>
</div>
</div>
<div v-show="currentSection == 'infos'" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Informations légales</h3>
</div>
<div class="panel-body">
<?= $form->field($model, 'mentions')
->textarea(['rows' => 15])
->hint('') ?>
<?= $form->field($model, 'gcs')
->textarea(['rows' => 15])
->hint('') ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton('Mettre à jour', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

+ 4
- 0
backend/web/js/vuejs/producer-update.js Näytä tiedosto

@@ -19,6 +19,10 @@ var app = new Vue({
{
name: 'credit-payment',
nameDisplay: 'Crédit / paiement en ligne'
},
{
name: 'infos',
nameDisplay: 'Informations légales'
}
]
},

+ 6
- 2
common/models/Producer.php Näytä tiedosto

@@ -56,6 +56,8 @@ use yii\helpers\Html;
* @property string $city
* @property float credit_limit_reminder
* @property boolean online_payment
* @property string mentions
* @property string gcs
*/
class Producer extends ActiveRecordCommon
{
@@ -86,7 +88,7 @@ class Producer extends ActiveRecordCommon
$this->addError($attribute, 'Ce code est déjà utilisé par un autre producteur.');
}
}],
[['description', 'order_infos','slug','secret_key_payplug'], 'string'],
[['description','mentions','gcs','order_infos','slug','secret_key_payplug'], 'string'],
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription'], 'boolean'],
[['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code','type'], 'string', 'max' => 255],
[['free_price', 'credit_limit_reminder'], 'double'],
@@ -121,7 +123,9 @@ class Producer extends ActiveRecordCommon
'credit_limit_reminder' => 'Seuil de crédit limite avant relance',
'online_payment' => 'Activer le paiement en ligne',
'secret_key_payplug' => 'Clé secrète Payplug',
'user_manage_subscription' => 'Autoriser les utilisateurs à gérer leurs abonnements'
'user_manage_subscription' => 'Autoriser les utilisateurs à gérer leurs abonnements',
'mentions' => 'Mentions légales',
'gcs' => 'Conditions générales de vente',
];
}


+ 17
- 0
console/migrations/m190204_151019_add_champs_infos_legales.php Näytä tiedosto

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

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

class m190204_151019_add_champs_infos_legales extends Migration {

public function up() {
$this->addColumn('producer', 'mentions', Schema::TYPE_TEXT) ;
$this->addColumn('producer', 'gcs', Schema::TYPE_TEXT) ;
}

public function down() {
$this->dropColumn('producer', 'mentions') ;
$this->dropColumn('producer', 'gcs') ;
}
}

Loading…
Peruuta
Tallenna