ソースを参照

Correctifs

refactoring
Guillaume Bourgeois 1年前
コミット
004a84007c
4個のファイルの変更15行の追加4行の削除
  1. +12
    -2
      backend/controllers/BackendController.php
  2. +1
    -1
      backend/views/layouts/content.php
  3. +1
    -1
      backend/views/layouts/left.php
  4. +1
    -0
      producer/controllers/OrderController.php

+ 12
- 2
backend/controllers/BackendController.php ファイルの表示

@@ -47,8 +47,18 @@ class BackendController extends CommonController
{
public function beforeAction($event)
{
$producerCurrent = $this->getProducerCurrent();

// Contexte producteur
$this->getLogic()->setProducerContext($this->getProducerCurrent());
if($producerCurrent) {
$this->getLogic()->setProducerContext($producerCurrent);
}

// Pas de producteur défini
if(!$producerCurrent) {
$this->redirect(\Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/index']));
return false;
}

return parent::beforeAction($event);
}
@@ -64,7 +74,7 @@ class BackendController extends CommonController
}
}

public function getProducerCurrent(): Producer
public function getProducerCurrent(): ?Producer
{
return Producer::searchOne();
}

+ 1
- 1
backend/views/layouts/content.php ファイルの表示

@@ -80,7 +80,7 @@ $producerManager = $this->getProducerManager();
<section class="content">

<?php $producer = GlobalParam::getCurrentProducer(); ?>
<?php if(!$producerManager->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?>
<?php if($producer && !$producerManager->isUpToDateWithOpendistribVersion($producer) && $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">&times;</span></a>

+ 1
- 1
backend/views/layouts/left.php ファイルの表示

@@ -50,7 +50,7 @@ $userManager = $this->getUserManager();
<?php
$producer = GlobalParam::getCurrentProducer();
$newVersionOpendistribTemplate = '';
if(!$producerManager->isUpToDateWithOpendistribVersion($producer)) {
if($producer && !$producerManager->isUpToDateWithOpendistribVersion($producer)) {
$newVersionOpendistribTemplate = '<span class="pull-right-container"><small class="label pull-right bg-orange">&nbsp;</small></span>';
}
?>

+ 1
- 0
producer/controllers/OrderController.php ファイルの表示

@@ -342,6 +342,7 @@ class OrderController extends ProducerBaseController

$errorPointSale = false;
if (isset($distribution) && $distribution) {
$order->populateDistribution($distribution);
$pointSale = $pointSaleManager->findOnePointSaleById($posts['Order']['id_point_sale']);
$pointSaleDistribution = $pointSaleDistributionManager->findOnePointSaleDistribution($distribution, $pointSale);


読み込み中…
キャンセル
保存