Переглянути джерело

Correctifs migration

feature/souke
Guillaume Bourgeois 1 рік тому
джерело
коміт
62ee13672b
4 змінених файлів з 16 додано та 20 видалено
  1. +6
    -10
      common/logic/Producer/Producer/Service/ProducerManager.php
  2. +3
    -3
      console/migrations/m190205_160337_produit_don_distrib.php
  3. +6
    -6
      frontend/forms/PasswordResetRequestForm.php
  4. +1
    -1
      frontend/forms/SignupForm.php

+ 6
- 10
common/logic/Producer/Producer/Service/ProducerManager.php Переглянути файл

@@ -10,16 +10,12 @@ class ProducerManager extends AbstractService implements ManagerInterface
{
public function sendEmailNewProducer(Producer $producer): void
{
\Yii::$app->mailer->compose(
\Yii::$app->mailerService->sendAdmin(
'Nouveau producteur',
'new-producer',
[
'html' => 'new-producer-html',
'text' => 'new-producer-text'
], [
'producer' => $producer
])
->setTo(\Yii::$app->parameterBag->get('adminEmail'))
->setFrom([\Yii::$app->parameterBag->get('adminEmail') => 'Opendistrib'])
->setSubject('[Opendistrib] Nouveau producteur')
->send();
'producer' => $producer
]
);
}
}

+ 3
- 3
console/migrations/m190205_160337_produit_don_distrib.php Переглянути файл

@@ -5,7 +5,7 @@ use yii\db\Migration;
class m190205_160337_produit_don_distrib extends Migration {

public function up() {
$this->insert('product', [
/*$this->insert('product', [
'name' => 'Don',
'description' => 'Don à la plateforme distrib',
'recipe' => '',
@@ -24,10 +24,10 @@ class m190205_160337_produit_don_distrib extends Migration {
'id_producer' => 0,
'sale_mode' => 'unit',
'order' => 1000,
]) ;
]);*/
}

public function down() {
$this->delete('product', 'name = \'Don\' AND id_producer = 0') ;
//$this->delete('product', 'name = \'Don\' AND id_producer = 0') ;
}
}

+ 6
- 6
frontend/forms/PasswordResetRequestForm.php Переглянути файл

@@ -85,12 +85,12 @@ class PasswordResetRequestForm extends Model
}

if ($user->save()) {
return \Yii::$app->mailer->compose(['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], ['user' => $user])
->setFrom(['contact@opendistrib.net' => 'distrib'])
->setTo($this->email)
->setSubject('[Opendistrib] Mot de passe oublié')
->send();
return \Yii::$app->mailerService->sendFromSite(
'Mot de passe oublié',
'passwordResetToken',
['user' => $user],
$this->email
);
}
}


+ 1
- 1
frontend/forms/SignupForm.php Переглянути файл

@@ -239,7 +239,7 @@ class SignupForm extends Model

if ($this->validate()) {

$user = $userModule->instanciateUser();
$user = $userModule->instanciateUser(User::TYPE_INDIVIDUAL);
$this->populateUser($user);

if ($this->isProducer()) {

Завантаження…
Відмінити
Зберегти