@@ -74,7 +74,8 @@ class DashboardAdminController extends BackendController | |||
'countUsersOnline' => $this->getUserModule()->getRepository()->countUsersOnline(), | |||
'countTicketsAdminOpen' => $this->getTicketModule()->getRepository()->countTicketsAdminStatusOpen(), | |||
'countTicketsAdminUnread' => $this->getTicketModule()->getRepository()->countTicketsAdminUnreadByUser($this->getUserCurrent()), | |||
'statisticsCacheHtml' => \Yii::$app->cache->get('dashboard_statistics10') ?: '' | |||
'usersWithStatusProducerOnlineArray' => $this->getUserModule()->getRepository()->findUsersWithStatusProducerAndOnline() | |||
//'statisticsCacheHtml' => \Yii::$app->cache->get('dashboard_statistics12') ?: '', | |||
]); | |||
} | |||
@@ -86,7 +87,7 @@ class DashboardAdminController extends BackendController | |||
public function actionAjaxStatisticsHtml() | |||
{ | |||
return \Yii::$app->cache->getOrSet('dashboard_statistics10', function () { | |||
return \Yii::$app->cache->getOrSet('dashboard_statistics12', function () { | |||
$producerModule = $this->getProducerModule(); | |||
$pointSaleModule = $this->getPointSaleModule(); | |||
$userModule = $this->getUserModule(); |
@@ -1,8 +1,11 @@ | |||
<?php | |||
use common\helpers\AdminLTE; | |||
use common\helpers\Image; | |||
use yii\helpers\Html; | |||
$this->setTitle('Tableau de bord'); | |||
$this->setMetaRefresh(true); | |||
?> | |||
@@ -17,6 +20,22 @@ $this->setTitle('Tableau de bord'); | |||
Yii::$app->urlManager->createUrl('online-admin/index') | |||
) ?> | |||
</div> | |||
<div class="col-lg-6 col-xs-6" id="producers-online"> | |||
<!--<h3>Producteurs en ligne :</h3>--> | |||
<?php if($usersWithStatusProducerOnlineArray && count($usersWithStatusProducerOnlineArray) > 0): ?> | |||
<?php foreach ($usersWithStatusProducerOnlineArray as $userWithStatusProducerOnline): ?> | |||
<?php $producer = $userWithStatusProducerOnline->producer; ?> | |||
<?php if($producer): ?> | |||
<a class="btn btn-default" title="Aller sur le compte de ce producteur" href="<?= $this->getUrlManagerBackend()->createUrl(['site/switch-producer', 'id' => $producer->id]); ?>"> | |||
<?= $producer->name; ?> | |||
</a> | |||
<?php endif; ?> | |||
<?php endforeach; ?> | |||
<div class="clr"></div> | |||
<?php else: ?> | |||
<div class="alert alert-info">Aucun producteur en ligne actuellement.</div> | |||
<?php endif; ?> | |||
</div> | |||
</div> | |||
<div class="row"> | |||
<div class="col-lg-6 col-xs-6"> | |||
@@ -41,6 +60,6 @@ $this->setTitle('Tableau de bord'); | |||
</div> | |||
<div id="dashboard-admin-statistics-html"> | |||
<?= $statisticsCacheHtml ?> | |||
<a class="btn btn-default btn-load" href="javascript:void(0);">Charger les statistiques</a> | |||
</div> | |||
</div> |
@@ -68,7 +68,6 @@ $this->setMetaRefresh(true); | |||
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>/uploads/<?= $producer->logo; ?>" | |||
alt="Logo <?= Html::encode($producer->name) ?>"> | |||
<?php endif; ?> | |||
<h3 class="profile-username text-center"> | |||
<a title="Aller sur le compte de ce producteur" href="<?= $this->getUrlManagerBackend()->createUrl(['site/switch-producer', 'id' => $producer->id]); ?>"> | |||
<?= $producer->name; ?> |
@@ -3152,6 +3152,11 @@ termes. | |||
color: white; | |||
} | |||
/* line 4, ../sass/dashboard-admin/_index.scss */ | |||
.dashboard-admin-index #producers-online h3 { | |||
margin-top: 0px; | |||
} | |||
/** | |||
Copyright distrib (2018) | |||
@@ -72,8 +72,11 @@ var UrlManager = { | |||
function opendistrib_dashboard_admin_statistics() { | |||
var selector = '#dashboard-admin-statistics-html'; | |||
if($(selector).length) { | |||
$.get(UrlManager.getBaseUrl() + 'dashboard-admin/ajax-statistics-html', {}, function(result) { | |||
$(selector).html(result); | |||
$(selector+' .btn-load').click(function() { | |||
$(selector).html('Chargement ...'); | |||
$.get(UrlManager.getBaseUrl() + 'dashboard-admin/ajax-statistics-html', {}, function(result) { | |||
$(selector).html(result); | |||
}); | |||
}); | |||
} | |||
} |
@@ -1,4 +1,8 @@ | |||
.dashboard-admin-index { | |||
#producers-online { | |||
h3 { | |||
margin-top: 0px; | |||
} | |||
} | |||
} |