瀏覽代碼

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

feature/souke
Guillaume Bourgeois 1 年之前
父節點
當前提交
74c32f4cb7
共有 2 個檔案被更改,包括 24 行新增1 行删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存