Procházet zdrojové kódy

[Administration] Utilisateurs : vue récapitulative et nouveau menu de navigation

feature/souke
Guillaume Bourgeois před 9 měsíci
rodič
revize
f368929718
9 změnil soubory, kde provedl 460 přidání a 367 odebrání
  1. +5
    -5
      backend/views/distribution/index.php
  2. +1
    -3
      backend/views/online-admin/index.php
  3. +55
    -60
      backend/views/user/index.php
  4. +49
    -19
      backend/views/user/view.php
  5. +311
    -279
      backend/web/css/screen.css
  6. +8
    -0
      backend/web/sass/distribution/_index.scss
  7. +7
    -1
      backend/web/sass/screen.scss
  8. +15
    -0
      backend/web/sass/user/_index.scss
  9. +9
    -0
      backend/web/sass/user/_view.scss

+ 5
- 5
backend/views/distribution/index.php Zobrazit soubor

@@ -383,19 +383,19 @@ $this->setPageTitle('Distributions') ;
<span class="label label-success" v-if="!order.date_update && !order.date_delete"><span class="glyphicon glyphicon-check"></span></span>
</td>
<td class="column-user">
<span v-if="order.user">
<a :href="baseUrl+'/user/view?id='+order.id_user" target="_blank" v-if="order.user">
<template v-if="order.user.name_legal_person && order.user.name_legal_person.length">
{{ order.user.name_legal_person }}
</template>
<template v-else>
{{ order.user.lastname+' '+order.user.name }}
</template>
<span class="shortcuts btn-group" role="group">
<!--<span class="shortcuts btn-group" role="group">
<a :class="order.user.credit_active ? 'btn btn-success btn-sm' : 'btn btn-default btn-sm'" :href="baseUrl+'/user/credit?id='+order.id_user" data-toggle="popover" data-trigger="hover" data-placement="bottom" :data-content="order.user.credit.toFixed(2)+' €'"><span class="glyphicon glyphicon-euro"></span></a>
<a class="btn btn-default btn-sm" :href="baseUrl+'/user/update?id='+order.id_user" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="Modifier"><span class="glyphicon glyphicon-user"></span></a>
<a class="btn btn-default btn-sm" :href="baseUrl+'/user/orders?id='+order.id_user" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="Voir les commandes"><span class="glyphicon glyphicon-eye-open"></span></a>
</span>
</span>
</span>-->
</a>
<span v-else class="no-user">{{ order.username }}</span>
<span v-if="order.comment && order.comment.length > 0" class="glyphicon glyphicon-comment"></span>
<span v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="glyphicon glyphicon-home"></span>
@@ -421,7 +421,7 @@ $this->setPageTitle('Distributions') ;
</td>
<td class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.credit == 1)">
<template v-if="order.isCreditContext">
<a :href="baseUrl+'/user/credit?id='+order.id_user" :class="order.user.credit >= 0 ? 'positive' : 'negative'">
<a :href="baseUrl+'/user/credit?id='+order.id_user" target="_blank" :class="order.user.credit >= 0 ? 'positive' : 'negative'">
{{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}
</a>
</template>

+ 1
- 3
backend/views/online-admin/index.php Zobrazit soubor

@@ -103,9 +103,7 @@ $this->setMetaRefresh(true);
<div class="box box-primary box-user">
<div class="box-body box-profile">
<h3 class="profile-username text-center">
<a title="Voir" href="<?= $this->getUrlManagerBackend()->createUrl(['user/view', 'id' => $userWithStatusUserOnline->id]); ?>">
<?= $userModule->getSolver()->getUsername($userWithStatusUserOnline); ?>
</a>
<?= $userModule->getSolver()->getUsername($userWithStatusUserOnline); ?>
</h3>
<p class="text-muted text-center">
<?php $userProducerArray = $userWithStatusUserOnline->userProducer; ?>

+ 55
- 60
backend/views/user/index.php Zobrazit soubor

@@ -37,6 +37,7 @@
*/

use common\helpers\GlobalParam;
use common\helpers\Price;
use domain\Order\Order\Order;
use domain\Producer\Producer\ProducerModule;
use domain\User\User\UserModule;
@@ -117,46 +118,27 @@ $this->render('_menu_filter', [
}
],
[
'attribute' => 'id_user_user_group',
'header' => 'Groupes',
'attribute' => 'credit',
'format' => 'raw',
'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'filter' => $userGroupModule->getRepository()->populateUserGroupDropdownList(false),
'value' => function ($user) {
$html = '';
foreach($user->userUserGroup as $userUserGroup) {
$html .= '<span class="label label-default">'.$userUserGroup->userGroup->name.'</span> ';
}
'contentOptions' => ['class' => 'column-hide-on-mobile align-center'],
'value' => function ($model) use ($producer) {
$userProducer = UserProducer::searchOne([
'id_user' => $model->id
]);
$credit = $userProducer ? $userProducer->credit : 0;
$classBtnCredit = $userProducer->credit_active ? 'btn-success' : 'btn-default';
$html = '<a class="btn '.$classBtnCredit.'" href="'.Yii::$app->urlManager->createUrl(['user/credit', 'id' => $model->id]).'">'.Price::format($credit).'</a>';
return $html;
}
],
[
'attribute' => 'newsletter',
'header' => "Inscrit au bulletin<br/>d'information",
'format' => 'raw',
'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'filter' => [
0 => 'Non',
1 => 'Oui'
],
'value' => function ($user) use ($userModule) {
if($userModule->isUserSubscribedNewsletter($user)) {
return '<span class="label label-success">Oui</span>';
}
return '<span class="label label-danger">Non</span>';
}
],
[
'class' => 'yii\grid\ActionColumn',
'header' => 'Commandes',
'template' => '{orders}',
'headerOptions' => ['class' => 'actions column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile align-center'],
'buttons' => [
'orders' => function ($url, $model) {
$url = Yii::$app->urlManager->createUrl(['user/orders', 'id' => $model['id']]);
@@ -166,11 +148,11 @@ $this->render('_menu_filter', [

$html = '';
if ($countOrders) {
$html .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> ' . $countOrders, $url, [
$html .= Html::a($countOrders.' commande'.($countOrders > 1 ? 's' : ''), $url, [
'title' => 'Commandes', 'class' => 'btn btn-default '
]);;
} else {
$html .= 'Aucune commande';
$html .= 'Aucune';
}

return $html;
@@ -178,35 +160,48 @@ $this->render('_menu_filter', [
],
],
[
'attribute' => 'credit',
'attribute' => 'newsletter',
'header' => "Inscrit au bulletin<br/>d'information",
'format' => 'raw',
'value' => function ($model) use ($producer) {
$userProducer = UserProducer::searchOne([
'id_user' => $model->id
]);
$credit = $userProducer ? $userProducer->credit : 0;
$classBtnCredit = $userProducer->credit_active ? 'btn-success' : 'btn-default';

$html = '<div class="input-group">
<input type="text" class="form-control input-credit" readonly="readonly" value="' . number_format($credit, 2) . ' €" placeholder="">
<span class="input-group-btn">
' . Html::a(
'<span class="glyphicon glyphicon-euro"></span>',
Yii::$app->urlManager->createUrl(['user/credit', 'id' => $model->id]),
[
'title' => 'Crédit',
'class' => 'btn ' . $classBtnCredit
]
) . '
</span>
</div>';

'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile align-center'],
'filter' => [
0 => 'Non',
1 => 'Oui'
],
'value' => function ($user) use ($userModule) {
if($userModule->isUserSubscribedNewsletter($user)) {
return '<span class="label label-success">Oui</span>';
}
return '<span class="label label-danger">Non</span>';
}
],
[
'attribute' => 'id_user_user_group',
'header' => 'Groupes',
'format' => 'raw',
'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'filter' => $userGroupModule->getRepository()->populateUserGroupDropdownList(false),
'value' => function ($user) {
$html = '';
foreach($user->userUserGroup as $userUserGroup) {
$html .= '<span class="label label-default">'.$userUserGroup->userGroup->name.'</span> ';
}
return $html;
}
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {delete} {switch}',
'template' => '{view} {update}
<div class="wrapper-button-dropdown">
<button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
<ul class="dropdown-menu">
<li>{delete}</li>
<li>{switch}</li>
</ul></div>',
'headerOptions' => ['class' => 'column-actions'],
'contentOptions' => ['class' => 'column-actions'],
'buttons' => [
@@ -227,20 +222,20 @@ $this->render('_menu_filter', [
]);
},
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>',
return Html::a('<span class="glyphicon glyphicon-minus"></span> Enlever',
Yii::$app->urlManager->createUrl(array_merge(['user/delete', 'id' => $model->id], Yii::$app->getRequest()->getQueryParams())),
[
'title' => 'Supprimer',
'class' => 'btn btn-default btn-confirm-delete'
'title' => 'Enlever',
'class' => 'btn-confirm-delete'
]);
},
'switch' => function($url, $model) use ($userModule, $userCurrent) {
if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)) {
return Html::a('<span class="glyphicon glyphicon-user"></span>',
return Html::a('<i class="fa fa-fw fa-user-secret"></i> Prendre la main',
Yii::$app->urlManager->createUrl(['user/switch-identity', 'id' => $model->id]),
[
'title' => 'Prendre la main',
'class' => 'btn btn-default'
'class' => ''
]);
}
}

+ 49
- 19
backend/views/user/view.php Zobrazit soubor

@@ -103,11 +103,12 @@ $this->addBreadcrumb('Récapitulatif') ;
</li>
<?php endif; ?>
<?php if($model->address): ?>
<li class="list-group-item">
<li class="list-group-item list-group-item-address">
<strong>Adresse</strong>
<span class="pull-right">
<?= $model->address ?>
<?= nl2br($model->address) ?>
</span>
<div class="clr"></div>
</li>
<?php endif; ?>
<li class="list-group-item">
@@ -143,24 +144,34 @@ $this->addBreadcrumb('Récapitulatif') ;
</div>
</div>

<?php if(isset($pointSaleBillingArray) && $pointSaleBillingArray && count($pointSaleBillingArray) > 0): ?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-sticky-note-o"></i>
Contact facturation
</h3>
</div>
<div class="panel-body">
<?php foreach($pointSaleBillingArray as $pointSale): ?>
<a class="btn btn-default btn-sm" href="<?= Yii::$app->urlManager->createUrl(['point-sale/update', 'id' => $pointSale->id]) ?>">
<i class="fa fa-map-marker"></i>
<?= $pointSale->name ?>
</a><br />
<?php endforeach; ?>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-log-in"></span>
Dernière connexion et inscription
</h3>
</div>
<?php endif; ?>
<div class="panel-body">
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<strong>Dernière connexion</strong>
<span class="pull-right">
<?php if($model->date_last_connection): ?>
<?= date('d/m/Y à H:i:s', strtotime($model->date_last_connection)) ?>
<?php else: ?>
--
<?php endif; ?>
</span>
</li>
<li class="list-group-item">
<strong>Inscription</strong>
<span class="pull-right">
<?= date('d/m/Y à H:i:s', $model->created_at) ?>
</span>
</li>
</ul>
</div>
</div>

<?php if($model->email): ?>
<div class="panel panel-default">
@@ -266,6 +277,25 @@ $this->addBreadcrumb('Récapitulatif') ;
</div>
</div>

<?php if(isset($pointSaleBillingArray) && $pointSaleBillingArray && count($pointSaleBillingArray) > 0): ?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-sticky-note-o"></i>
Contact facturation
</h3>
</div>
<div class="panel-body">
<?php foreach($pointSaleBillingArray as $pointSale): ?>
<a class="btn btn-default btn-sm" href="<?= Yii::$app->urlManager->createUrl(['point-sale/update', 'id' => $pointSale->id]) ?>">
<i class="fa fa-map-marker"></i>
<?= $pointSale->name ?>
</a><br />
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>

</div>
<div class="clr"></div>
</div>

+ 311
- 279
backend/web/css/screen.css
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 8
- 0
backend/web/sass/distribution/_index.scss Zobrazit soubor

@@ -261,6 +261,14 @@ termes.
display: block;
}

a {
color: #333;

&:hover {
text-decoration: underline;
}
}

.shortcuts {
display: none;
float: right;

+ 7
- 1
backend/web/sass/screen.scss Zobrazit soubor

@@ -67,6 +67,10 @@ a {
float: left;
}

.align-center {
text-align: center ;
}

#block-demo {
padding: 10px 0px ;
background-color: $color2 ;
@@ -1533,7 +1537,9 @@ a.btn, button.btn {
@import "distribution/_index.scss" ;
@import "user/_emails.scss" ;
@import "user/_credit.scss" ;
@import "user/_form.scss" ;
@import "user/_form.scss" ;
@import "user/_view.scss" ;
@import "user/_index.scss" ;
@import "producer/_update.scss" ;
@import "point_sale/_index.scss" ;
@import "point_sale/_form.scss" ;

+ 15
- 0
backend/web/sass/user/_index.scss Zobrazit soubor

@@ -0,0 +1,15 @@

.user-index {
.wrapper-button-dropdown {
display: inline-block;
position: relative;

.dropdown-menu {
left: -138px;

a {
color: #333;
}
}
}
}

+ 9
- 0
backend/web/sass/user/_view.scss Zobrazit soubor

@@ -0,0 +1,9 @@

.user-view {
.list-group-item-address {
.pull-right {
text-align: right;
}
}
}


Načítá se…
Zrušit
Uložit