*/ | */ | ||||
use domain\Distribution\Distribution\DistributionModule; | use domain\Distribution\Distribution\DistributionModule; | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\Feature\Feature\FeatureModule; | |||||
use domain\Order\Order\Order; | use domain\Order\Order\Order; | ||||
use domain\Order\Order\OrderModule; | use domain\Order\Order\OrderModule; | ||||
use domain\Producer\Producer\ProducerModule; | use domain\Producer\Producer\ProducerModule; | ||||
$producerModule = ProducerModule::getInstance(); | $producerModule = ProducerModule::getInstance(); | ||||
$settingModule = SettingModule::getInstance(); | $settingModule = SettingModule::getInstance(); | ||||
$adminSettingBag = $settingModule->getAdminSettingBag(); | $adminSettingBag = $settingModule->getAdminSettingBag(); | ||||
$featureChecker = FeatureModule::getInstance()->getChecker(); | |||||
$this->setTitle('Tableau de bord'); | $this->setTitle('Tableau de bord'); | ||||
?> | ?> | ||||
<div class="dashboard-index"> | <div class="dashboard-index"> | ||||
<div <?php if($adminSettingBag->get('forumFlarumUrl')): ?>class="col-md-8"<?php endif; ?>> | |||||
<div <?php if($featureChecker->isEnabled(Feature::ALIAS_FORUM)): ?>class="col-md-8"<?php endif; ?>> | |||||
<?php if(Yii::$app->request->get('error_products_points_sale')): ?> | <?php if(Yii::$app->request->get('error_products_points_sale')): ?> | ||||
<div class="alert alert-warning"> | <div class="alert alert-warning"> | ||||
Vous devez ajouter <?php if(!$productsCount): ?> des produits<?php endif; ?> | Vous devez ajouter <?php if(!$productsCount): ?> des produits<?php endif; ?> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</div> | </div> | ||||
<?php if($adminSettingBag->get('forumFlarumUrl')): ?> | |||||
<?php if($featureChecker->isEnabled(Feature::ALIAS_FORUM)): ?> | |||||
<div class="col-md-4"> | <div class="col-md-4"> | ||||
<div class="panel panel-default"> | <div class="panel panel-default"> | ||||
<div class="panel-heading"> | <div class="panel-heading"> | ||||
</h3> | </h3> | ||||
</div> | </div> | ||||
<div class="panel-body"> | <div class="panel-body"> | ||||
<?php //echo print_r($forumDiscussionsArray); ?> | |||||
<?php if($forumDiscussionsArray && count($forumDiscussionsArray['data'])): ?> | <?php if($forumDiscussionsArray && count($forumDiscussionsArray['data'])): ?> | ||||
<table class="table"> | <table class="table"> | ||||
<?php $forumDiscussionsLimitedArray = array_slice($forumDiscussionsArray['data'], 0, min(3, count($forumDiscussionsArray['data']))); ?> | <?php $forumDiscussionsLimitedArray = array_slice($forumDiscussionsArray['data'], 0, min(3, count($forumDiscussionsArray['data']))); ?> | ||||
<?php foreach($forumDiscussionsLimitedArray as $forumDiscussion): ?> | <?php foreach($forumDiscussionsLimitedArray as $forumDiscussion): ?> | ||||
<tr> | <tr> | ||||
<?php //echo print_r($forumDiscussion); ?> | |||||
<td><?= $forumDiscussion['attributes']['title']; ?></td> | <td><?= $forumDiscussion['attributes']['title']; ?></td> | ||||
<td><?= date('d/m à H:i', strtotime($forumDiscussion['attributes']['lastPostedAt'])); ?></td> | <td><?= date('d/m à H:i', strtotime($forumDiscussion['attributes']['lastPostedAt'])); ?></td> | ||||
</tr> | </tr> | ||||
<p>Aucun sujet sur le forum.</p> | <p>Aucun sujet sur le forum.</p> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<p> | <p> | ||||
<a href="<?= $settingModule->getAdminSettingBag()->get('forumFlarumUrl'); ?>" class="btn btn-default"> | |||||
<a href="<?= $settingModule->getAdminSettingBag()->get('forumFlarumUrl'); ?>" class="btn btn-default" target="_blank"> | |||||
<span class="fa fa-comments"></span> | <span class="fa fa-comments"></span> | ||||
Consulter le forum | Consulter le forum | ||||
</a> | </a> |
use common\helpers\Image; | use common\helpers\Image; | ||||
use common\helpers\Price; | use common\helpers\Price; | ||||
use domain\Distribution\Distribution\Distribution; | use domain\Distribution\Distribution\Distribution; | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\Feature\Feature\FeatureModule; | |||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use domain\Producer\Producer\ProducerModule; | use domain\Producer\Producer\ProducerModule; | ||||
use domain\Setting\AdminSettingBag; | |||||
use domain\User\User\UserModule; | use domain\User\User\UserModule; | ||||
use common\helpers\Environment; | use common\helpers\Environment; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$producerModule = ProducerModule::getInstance(); | $producerModule = ProducerModule::getInstance(); | ||||
$producer = GlobalParam::getCurrentProducer(); | $producer = GlobalParam::getCurrentProducer(); | ||||
$userCurrent = GlobalParam::getCurrentUser(); | $userCurrent = GlobalParam::getCurrentUser(); | ||||
$featureChecker = FeatureModule::getInstance()->getChecker(); | |||||
$adminSettingBag = AdminSettingBag::getInstance(); | |||||
?> | ?> | ||||
</a> | </a> | ||||
</li> | </li> | ||||
<?php if ($userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent)): ?> | <?php if ($userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent)): ?> | ||||
<li> | <li> | ||||
<a href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => GlobalParam::getCurrentProducer()->slug]); ?>"> | <a href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => GlobalParam::getCurrentProducer()->slug]); ?>"> | ||||
</li> | </li> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php if($featureChecker->isEnabled(Feature::ALIAS_FORUM)): ?> | |||||
<li> | |||||
<a href="<?= $adminSettingBag->get('forumFlarumUrl') ?>" target="_blank"> | |||||
<i class="bi bi-people"></i> | |||||
<span class="hidden-xs hidden-sm">Forum</span> | |||||
</a> | |||||
</li> | |||||
<?php endif; ?> | |||||
<li class="dropdown user user-menu"> | <li class="dropdown user user-menu"> | ||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||||
<i class="bi bi-person"></i> | <i class="bi bi-person"></i> |
<div class="info-box"> | <div class="info-box"> | ||||
<span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span> | <span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span> | ||||
<div class="info-box-content"> | <div class="info-box-content"> | ||||
<span class="info-box-text"><br/><?= Html::a("Ouvrir une discussion sur le forum", $adminSettingBag->get('forumFlarumUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?></span> | |||||
<span class="info-box-text"><br/><?= Html::a("Aller sur le forum", $adminSettingBag->get('forumFlarumUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?></span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> |
const ALIAS_SPONSORSHIP = 'sponsorship'; | const ALIAS_SPONSORSHIP = 'sponsorship'; | ||||
const ALIAS_BRIDGE_EVOLIZ = 'bridge_evoliz'; | const ALIAS_BRIDGE_EVOLIZ = 'bridge_evoliz'; | ||||
const ALIAS_PRODUCT_ACCESSORY = 'product_accessory'; | const ALIAS_PRODUCT_ACCESSORY = 'product_accessory'; | ||||
const ALIAS_FORUM = 'forum'; | |||||
/** | /** | ||||
* @inheritdoc | * @inheritdoc |
Feature::ALIAS_BRIDGE_SUMUP => "Pont vers SumUp", | Feature::ALIAS_BRIDGE_SUMUP => "Pont vers SumUp", | ||||
Feature::ALIAS_BRIDGE_EVOLIZ => "Pont vers Evoliz", | Feature::ALIAS_BRIDGE_EVOLIZ => "Pont vers Evoliz", | ||||
Feature::ALIAS_PRODUCT_ACCESSORY => 'Accessoires produits', | Feature::ALIAS_PRODUCT_ACCESSORY => 'Accessoires produits', | ||||
Feature::ALIAS_FORUM => 'Forum', | |||||
]; | ]; | ||||
} | } | ||||
} | } |