Преглед на файлове

[Administration] Forum : ajout feature forum

feature/rotating_product
Guillaume Bourgeois преди 4 месеца
родител
ревизия
8dfd9f0e56
променени са 5 файла, в които са добавени 23 реда и са изтрити 7 реда
  1. +6
    -5
      backend/views/dashboard/index.php
  2. +14
    -1
      backend/views/layouts/header.php
  3. +1
    -1
      backend/views/support/index.php
  4. +1
    -0
      domain/Feature/Feature/Feature.php
  5. +1
    -0
      domain/Feature/Feature/FeatureDefinition.php

+ 6
- 5
backend/views/dashboard/index.php Целия файл

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

use domain\Distribution\Distribution\DistributionModule;
use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule;
use domain\Order\Order\Order;
use domain\Order\Order\OrderModule;
use domain\Producer\Producer\ProducerModule;
@@ -52,12 +54,13 @@ $subscriptionModule = SubscriptionModule::getInstance();
$producerModule = ProducerModule::getInstance();
$settingModule = SettingModule::getInstance();
$adminSettingBag = $settingModule->getAdminSettingBag();
$featureChecker = FeatureModule::getInstance()->getChecker();

$this->setTitle('Tableau de bord');

?>
<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')): ?>
<div class="alert alert-warning">
Vous devez ajouter <?php if(!$productsCount): ?> des produits<?php endif; ?>
@@ -142,7 +145,7 @@ $this->setTitle('Tableau de bord');
<?php endif; ?>
</div>

<?php if($adminSettingBag->get('forumFlarumUrl')): ?>
<?php if($featureChecker->isEnabled(Feature::ALIAS_FORUM)): ?>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
@@ -151,13 +154,11 @@ $this->setTitle('Tableau de bord');
</h3>
</div>
<div class="panel-body">
<?php //echo print_r($forumDiscussionsArray); ?>
<?php if($forumDiscussionsArray && count($forumDiscussionsArray['data'])): ?>
<table class="table">
<?php $forumDiscussionsLimitedArray = array_slice($forumDiscussionsArray['data'], 0, min(3, count($forumDiscussionsArray['data']))); ?>
<?php foreach($forumDiscussionsLimitedArray as $forumDiscussion): ?>
<tr>
<?php //echo print_r($forumDiscussion); ?>
<td><?= $forumDiscussion['attributes']['title']; ?></td>
<td><?= date('d/m à H:i', strtotime($forumDiscussion['attributes']['lastPostedAt'])); ?></td>
</tr>
@@ -167,7 +168,7 @@ $this->setTitle('Tableau de bord');
<p>Aucun sujet sur le forum.</p>
<?php endif; ?>
<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>
Consulter le forum
</a>

+ 14
- 1
backend/views/layouts/header.php Целия файл

@@ -40,8 +40,11 @@ use common\helpers\GlobalParam;
use common\helpers\Image;
use common\helpers\Price;
use domain\Distribution\Distribution\Distribution;
use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use domain\Setting\AdminSettingBag;
use domain\User\User\UserModule;
use common\helpers\Environment;
use yii\helpers\Html;
@@ -50,6 +53,8 @@ $userModule = UserModule::getInstance();
$producerModule = ProducerModule::getInstance();
$producer = GlobalParam::getCurrentProducer();
$userCurrent = GlobalParam::getCurrentUser();
$featureChecker = FeatureModule::getInstance()->getChecker();
$adminSettingBag = AdminSettingBag::getInstance();

?>

@@ -309,7 +314,6 @@ $userCurrent = GlobalParam::getCurrentUser();
</a>
</li>


<?php if ($userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent)): ?>
<li>
<a href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => GlobalParam::getCurrentProducer()->slug]); ?>">
@@ -319,6 +323,15 @@ $userCurrent = GlobalParam::getCurrentUser();
</li>
<?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">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="bi bi-person"></i>

+ 1
- 1
backend/views/support/index.php Целия файл

@@ -120,7 +120,7 @@ $supportOnline = $adminSettingBag->get('supportOnline');
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span>
<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>

+ 1
- 0
domain/Feature/Feature/Feature.php Целия файл

@@ -55,6 +55,7 @@ class Feature extends ActiveRecordCommon
const ALIAS_SPONSORSHIP = 'sponsorship';
const ALIAS_BRIDGE_EVOLIZ = 'bridge_evoliz';
const ALIAS_PRODUCT_ACCESSORY = 'product_accessory';
const ALIAS_FORUM = 'forum';

/**
* @inheritdoc

+ 1
- 0
domain/Feature/Feature/FeatureDefinition.php Целия файл

@@ -25,6 +25,7 @@ class FeatureDefinition extends AbstractDefinition
Feature::ALIAS_BRIDGE_SUMUP => "Pont vers SumUp",
Feature::ALIAS_BRIDGE_EVOLIZ => "Pont vers Evoliz",
Feature::ALIAS_PRODUCT_ACCESSORY => 'Accessoires produits',
Feature::ALIAS_FORUM => 'Forum',
];
}
}

Loading…
Отказ
Запис