|
|
@@ -39,6 +39,7 @@ termes. |
|
|
|
use common\helpers\GlobalParam; |
|
|
|
use common\helpers\Price; |
|
|
|
use domain\Order\Order\OrderModule; |
|
|
|
use domain\Subscription\Subscription\SubscriptionModule; |
|
|
|
use domain\User\User\UserModule; |
|
|
|
use domain\User\UserProducer\UserProducerModule; |
|
|
|
use yii\helpers\Html; |
|
|
@@ -48,8 +49,10 @@ $userCurrent = GlobalParam::getCurrentUser(); |
|
|
|
$orderModule = OrderModule::getInstance(); |
|
|
|
$userModule = UserModule::getInstance(); |
|
|
|
$userProducerModule = UserProducerModule::getInstance(); |
|
|
|
$subscriptionModule = SubscriptionModule::getInstance(); |
|
|
|
$userProducer = $userProducerModule->findOneUserProducer($model); |
|
|
|
$username = Html::encode($userModule->getSolver()->getUsername($model)); |
|
|
|
$producer = GlobalParam::getCurrentProducer(); |
|
|
|
$this->setTitle($username.' (#'.$model->id.')') ; |
|
|
|
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; |
|
|
|
$this->addBreadcrumb(['label' => $username]) ; |
|
|
@@ -141,7 +144,9 @@ $this->addBreadcrumb('Récapitulatif') ; |
|
|
|
<strong>Points de vente</strong> |
|
|
|
<span class="pull-right"> |
|
|
|
<?php foreach($model->userPointSale as $userPointSale): ?> |
|
|
|
<span class="label label-default"><?= $userPointSale->pointSale->name; ?></span> |
|
|
|
<?php if($userPointSale->pointSale->id_producer == $producer->id): ?> |
|
|
|
<span class="label label-default"><?= $userPointSale->pointSale->name; ?></span> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endforeach; ?> |
|
|
|
</span> |
|
|
|
</li> |
|
|
@@ -298,7 +303,6 @@ $this->addBreadcrumb('Récapitulatif') ; |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
|
|
|
|
<?php $countOrders = $orderModule->getRepository()->countOrdersByUser($model); ?> |
|
|
|
<?php if($countOrders): ?> |
|
|
|
<ul class="list-group list-group-unbordered"> |
|
|
@@ -323,6 +327,51 @@ $this->addBreadcrumb('Récapitulatif') ; |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php $hasSubscription = $subscriptionsArray && count($subscriptionsArray); ?> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title"> |
|
|
|
<i class="glyphicon glyphicon-repeat"></i> |
|
|
|
Abonnements |
|
|
|
<?php if($hasSubscription): ?> |
|
|
|
<a class="btn btn-default btn-xs" href="<?= Yii::$app->urlManager->createUrl(['subscription/index','SubscriptionSearch[id_user]' => $model->id]) ?>"> |
|
|
|
<span class="glyphicon glyphicon-eye-open"></span> |
|
|
|
Voir |
|
|
|
</a> |
|
|
|
<?php else: ?> |
|
|
|
<a class="btn btn-default btn-xs" href="<?= Yii::$app->urlManager->createUrl(['subscription/create']) ?>"> |
|
|
|
<span class="glyphicon glyphicon-plus"></span> |
|
|
|
Créer |
|
|
|
</a> |
|
|
|
<?php endif; ?> |
|
|
|
</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<?php if($hasSubscription): ?> |
|
|
|
<ul class="list-group list-group-unbordered"> |
|
|
|
<?php foreach($subscriptionsArray as $subscription): ?> |
|
|
|
<li class="list-group-item"> |
|
|
|
<span class="pull-right"> |
|
|
|
<?= $subscriptionModule->getSolver()->getProductsListAsHtml($subscription) ?> |
|
|
|
</span> |
|
|
|
|
|
|
|
<strong><?= $subscriptionModule->getSolver()->getDaysAsHtml($subscription) ?></strong> |
|
|
|
(<?= strtolower($subscriptionModule->getSolver()->getWeekFrequencyAsString($subscription)) ?>)<br /> |
|
|
|
<?= Html::encode($subscription->pointSale->name); ?><br /> |
|
|
|
<?= $subscriptionModule->getSolver()->getPeriodAsHtml($subscription) ?> |
|
|
|
|
|
|
|
<div class="clr"></div> |
|
|
|
</li> |
|
|
|
<?php endforeach; ?> |
|
|
|
</ul> |
|
|
|
<?php else: ?> |
|
|
|
<div class="alert alert-info"> |
|
|
|
Aucun abonnement |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php if(isset($pointSaleBillingArray) && $pointSaleBillingArray && count($pointSaleBillingArray) > 0): ?> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |