Procházet zdrojové kódy

Correctifs

refactoring
Guillaume Bourgeois před 1 rokem
rodič
revize
004a84007c
4 změnil soubory, kde provedl 15 přidání a 4 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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);


Načítá se…
Zrušit
Uložit