Browse Source

Correctifs

refactoring
Guillaume Bourgeois 1 year ago
parent
commit
ce085a8110
3 changed files with 6 additions and 3 deletions
  1. +1
    -1
      common/logic/User/UserProducer/Repository/UserProducerRepository.php
  2. +1
    -1
      frontend/controllers/SiteController.php
  3. +4
    -1
      frontend/views/site/producer.php

+ 1
- 1
common/logic/User/UserProducer/Repository/UserProducerRepository.php View File

{ {
return UserProducer::searchOne([ return UserProducer::searchOne([
'id_user' => $user->id, 'id_user' => $user->id,
'id_producer' => $producer->id
'user_producer.id_producer' => $producer->id
]); ]);
} }



+ 1
- 1
frontend/controllers/SiteController.php View File

$signupForm->option_user_producer = 'user'; $signupForm->option_user_producer = 'user';
$returnUrl = $this->getRequest()->get('returnUrl', $this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug])); $returnUrl = $this->getRequest()->get('returnUrl', $this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug]));


if ($this->getUserCurrent()->identity->isGuest) {
if (Yii::$app->user->isGuest) {
if ($loginForm->load($this->getRequest()->post()) && $loginForm->login()) { if ($loginForm->load($this->getRequest()->post()) && $loginForm->login()) {
if (!strlen($producer->code)) { if (!strlen($producer->code)) {
$producerManager->addUser(GlobalParam::getCurrentUser(), $producer); $producerManager->addUser(GlobalParam::getCurrentUser(), $producer);

+ 4
- 1
frontend/views/site/producer.php View File

termes. termes.
*/ */


use common\logic\Producer\Producer\Wrapper\ProducerManager;
use yii\helpers\Html ; use yii\helpers\Html ;
use yii\bootstrap\ActiveForm; use yii\bootstrap\ActiveForm;


$producerManager = ProducerManager::getInstance();

$this->setTitle('Producteur '.Html::encode($producer->name)) ; $this->setTitle('Producteur '.Html::encode($producer->name)) ;
$this->setMeta('description', 'Veuillez vous connecter pour réserver les produits de ce producteur.') ; $this->setMeta('description', 'Veuillez vous connecter pour réserver les produits de ce producteur.') ;


<div class="col-md-6"> <div class="col-md-6">
<h2>Connexion</h2> <h2>Connexion</h2>
<?php if(isset($producer) && $producer->isDemo()) : ?>
<?php if(isset($producer) && $producerManager->isDemo($producer)) : ?>
<div class="alert alert-warning"> <div class="alert alert-warning">
<p>Merci d'utiliser les identifiants suivants pour vous connecter à l'espace de démonstration :</p> <p>Merci d'utiliser les identifiants suivants pour vous connecter à l'espace de démonstration :</p>
Identifiant : <strong>demo@opendistrib.net</strong><br /> Identifiant : <strong>demo@opendistrib.net</strong><br />

Loading…
Cancel
Save