Quellcode durchsuchen

Correctifs

refactoring
Guillaume Bourgeois vor 1 Jahr
Ursprung
Commit
004a84007c
4 geänderte Dateien mit 15 neuen und 4 gelöschten Zeilen
  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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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 Datei anzeigen

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


Laden…
Abbrechen
Speichern