Browse Source

Correctifs divers

refactoring
Guillaume 2 years ago
parent
commit
49690ef0d5
6 changed files with 19 additions and 15 deletions
  1. +3
    -1
      backend/views/point-sale/_form.php
  2. +1
    -1
      common/mail/createUserAdmin-html.php
  3. +1
    -1
      common/models/PointSale.php
  4. +5
    -7
      common/models/Producer.php
  5. +8
    -4
      frontend/views/site/index.php
  6. +1
    -1
      producer/controllers/SiteController.php

+ 3
- 1
backend/views/point-sale/_form.php View File

@@ -136,8 +136,10 @@ use common\models\ProductPrice ;
->hint('Cochez cette case si seulement un groupe restreint d\'utilisateurs peuvent accéder à ce point de vente.<br />'
. 'Dans le cas des boîtes à pain, il vous est possible de spécifier un commentaire pour chaque utilisateur sélectionné afin de lui renseigner son numéro de boîte ou son code.') ?>
<div id="users">

<?= Html::activeCheckboxList($model, 'users', ArrayHelper::map($users, 'user_id', function ($model_user, $defaultValue) use ($model) {
return Html::encode($model_user['lastname'] . ' ' . $model_user['name']) . '<br />'

return Html::encode(User::getUsernameFromArray($model_user)) . '<br />'
. Html::activeTextInput(
$model,
'users_comment[' . $model_user['user_id'] . ']',

+ 1
- 1
common/mail/createUserAdmin-html.php View File

@@ -43,7 +43,7 @@ use yii\helpers\Html;
<p>Bonjour <?= Html::encode($user->name); ?>,</p>

<p>Votre producteur <strong><?= Html::encode($producer->name); ?></strong> vient
de créer un compte pour vous sur le site <a href="http://www.opendistrib.net/">Opendistrib</a>.</p>
de créer un compte pour vous sur le site <a href="http://www.opendistrib.net/site/login">Opendistrib</a>.</p>

<p><strong>Ce compte vous permet de passer vos commandes dans cet établissement.</strong></p>


+ 1
- 1
common/models/PointSale.php View File

@@ -171,7 +171,7 @@ class PointSale extends ActiveRecordCommon
return [
'with' => [],
'join_with' => [],
'orderby' => '',
'orderby' => 'is_bread_box ASC, name ASC',
'attribute_id_producer' => 'point_sale.id_producer'
];
}

+ 5
- 7
common/models/Producer.php View File

@@ -424,14 +424,12 @@ class Producer extends ActiveRecordCommon
$departments = Departments::get();
$dataProducers = [];
$optionsProducers = [];

foreach ($producers as $p) {
if (!key_exists('d' . substr($p->postcode, 0, 2), $dataProducers)) {
$dataProducers['d' . substr($p->postcode, 0, 2)] = '<strong>' . $departments[substr(
$p->postcode,
0,
2
)] . '</strong>';
$optionsProducers['d' . substr($p->postcode, 0, 2)] = ['disabled' => true];
$departmentCode = substr($p->postcode, 0, 2);
if (!key_exists('d' . $departmentCode, $dataProducers) && isset($departments[$departmentCode])) {
$dataProducers['d' . $departmentCode] = '<strong>' . $departments[$departmentCode] . '</strong>';
$optionsProducers['d' . $departmentCode] = ['disabled' => true];
}

$dataProducers[$p->id] = '<span class="glyphicon glyphicon-lock"></span> ' . Html::encode(

+ 8
- 4
frontend/views/site/index.php View File

@@ -71,8 +71,9 @@ $this->setMeta('description', 'Simplifiez la distribution de vos produits en cir
</div>
<div class="panel-body">
<p class="presentation">Simplifiez la distribution de vos produits<br /> avec des outils adaptés.</p>
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/signup']) ; ?>"><span class="glyphicon glyphicon-user"></span> Je crée mon espace</a>
<!--<?php if($producerDemoAccount) : ?><a class="btn btn-default" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/producer', 'id' => $producerDemoAccount->id]) ; ?>"><span class="glyphicon glyphicon-blackboard"></span> Démonstration</a><?php endif; ?>-->
<?php if(Yii::$app->user->isGuest): ?>
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/signup']) ; ?>"><span class="glyphicon glyphicon-user"></span> Je crée mon espace</a>
<?php endif; ?>
<a class="btn btn-default" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/contact']) ; ?>"><span class="glyphicon glyphicon-info-sign"></span> Demande d'informations</a>
</div>
</div>
@@ -87,8 +88,11 @@ $this->setMeta('description', 'Simplifiez la distribution de vos produits en cir
</div>
<div class="panel-body">
<p class="presentation">Réservez vos produits en ligne et récupérez votre commande
chez votre producteur ou dans un dépôt près de chez vous.</p>
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/producers']) ; ?>"><span class="glyphicon glyphicon-search"></span> Je recherche un producteur</a>
chez votre producteur ou dans un dépôt près de chez vous.</p>
<?php if(Yii::$app->user->isGuest): ?>
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/signup']) ; ?>"><span class="glyphicon glyphicon-user"></span> Je m'inscris</a>
<?php endif; ?>
<a class="btn btn-default" href="<?= Yii::$app->urlManagerFrontend->createUrl(['site/producers']) ; ?>"><span class="glyphicon glyphicon-search"></span> Je recherche un producteur</a>
</div>
</div>
</div>

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

@@ -96,7 +96,7 @@ class SiteController extends ProducerBaseController
->where([
'id_producer' => $this->getProducer()->id,
'restricted_access' => 0
]),
])->orderBy('is_bread_box ASC, name ASC'),
'pagination' => [
'pageSize' => 50,
],

Loading…
Cancel
Save