Selaa lähdekoodia

[Administration] Tableau de bord : correctif lien export distribution cassé (404) #1396

feature/souke
Guillaume Bourgeois 1 vuosi sitten
vanhempi
commit
74c32f4cb7
2 muutettua tiedostoa jossa 24 lisäystä ja 1 poistoa
  1. +10
    -1
      backend/views/dashboard/index.php
  2. +14
    -0
      common/logic/Distribution/Distribution/Service/ExportManager.php

+ 10
- 1
backend/views/dashboard/index.php Näytä tiedosto

@@ -37,6 +37,7 @@ termes.
*/

use common\helpers\GlobalParam;
use common\logic\Distribution\Distribution\Module\DistributionModule;
use common\logic\Order\Order\Model\Order;
use common\logic\Order\Order\Module\OrderModule;
use common\logic\Producer\Producer\Module\ProducerModule;
@@ -44,6 +45,7 @@ use common\logic\Subscription\Subscription\Module\SubscriptionModule;
use common\logic\User\User\Module\UserModule;
use yii\helpers\Html ;

$distributionModule = DistributionModule::getInstance();
$userModule = UserModule::getInstance();
$orderModule = OrderModule::getInstance();
$subscriptionModule = SubscriptionModule::getInstance();
@@ -119,7 +121,14 @@ $this->setTitle('Tableau de bord');
<span class="info-box-number"></span>
<div class="buttons">
<?= Html::a('<span class="fa fa-eye"></span>', ['distribution/index', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?>
<?php if(count($distribution->order)): ?><?= Html::a('<span class="fa fa-download"></span>', ['distribution/report', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?><?php endif; ?>
<?php if(count($distribution->order)): ?>
<?php
$exportsEnabledArray = $distributionModule->getExportManager()->getAllEnabled();
foreach($exportsEnabledArray as $name => $export) {
echo Html::a('<span class="fa fa-download"></span>', ['distribution/export', 'name' => $name, 'date' => $distribution->date], ['class' => 'btn btn-default', 'title' => $export[0]]).' ';
}
?>
<?php endif; ?>
</div>
</div>
</div>

+ 14
- 0
common/logic/Distribution/Distribution/Service/ExportManager.php Näytä tiedosto

@@ -53,6 +53,20 @@ class ExportManager extends AbstractManager
];
}

public function getAllEnabled(): array
{
$exportsArray = $this->getAll();
$exportsEnabledArray = [];

foreach($exportsArray as $name => $export) {
if($this->isEnabled($name)) {
$exportsEnabledArray[$name] = $export;
}
}

return $exportsEnabledArray;
}

public function getExport(string $exportName): array
{
$exportsArray = $this->getAll();

Loading…
Peruuta
Tallenna