} | } | ||||
public function actionView($id) | |||||
{ | |||||
$pointSaleModule = $this->getPointSaleModule(); | |||||
$model = $this->findModel($id); | |||||
return $this->render('view', [ | |||||
'model' => $model, | |||||
'pointSaleBillingArray' => $pointSaleModule->findByBillingUser($model) | |||||
]); | |||||
} | |||||
public function actionUpdate($id) | public function actionUpdate($id) | ||||
{ | { | ||||
$userModule = $this->getUserModule(); | $userModule = $this->getUserModule(); | ||||
} | } | ||||
$this->setFlash('success', 'Utilisateur <strong>' . Html::encode($userModule->getUsername($model)) . '</strong> modifié.'); | $this->setFlash('success', 'Utilisateur <strong>' . Html::encode($userModule->getUsername($model)) . '</strong> modifié.'); | ||||
return $this->redirect(['index']); | |||||
return $this->redirect(['view', 'id' => $model->id]); | |||||
} | } | ||||
// Email de bienvenue | // Email de bienvenue | ||||
if ($mailWelcome) { | if ($mailWelcome) { | ||||
$this->getUserModule()->getManager()->welcome($model); | $this->getUserModule()->getManager()->welcome($model); | ||||
$this->setFlash('success', 'Email de bienvenue envoyé à <strong>' . Html::encode($userModule->getSolver()->getUsername($model)) . '</strong>.'); | $this->setFlash('success', 'Email de bienvenue envoyé à <strong>' . Html::encode($userModule->getSolver()->getUsername($model)) . '</strong>.'); | ||||
return $this->redirect(['update', 'id' => $model->id]); | |||||
return $this->redirect(['view', 'id' => $model->id]); | |||||
} | } | ||||
// Mot de passe oublié | // Mot de passe oublié | ||||
if ($newPassword) { | if ($newPassword) { | ||||
$this->getUserModule()->getManager()->newPassword($model); | $this->getUserModule()->getManager()->newPassword($model); | ||||
$this->setFlash('success', 'Nouveau mot de passe envoyé à <strong>' . Html::encode($userModule->getSolver()->getUsername($model)) . '</strong>.'); | $this->setFlash('success', 'Nouveau mot de passe envoyé à <strong>' . Html::encode($userModule->getSolver()->getUsername($model)) . '</strong>.'); | ||||
return $this->redirect(['update', 'id' => $model->id]); | |||||
return $this->redirect(['view', 'id' => $model->id]); | |||||
} | } | ||||
} else { | } else { | ||||
throw new UserException("Vous ne pouvez pas modifier cet utilisateur."); | throw new UserException("Vous ne pouvez pas modifier cet utilisateur."); |
<?= | <?= | ||||
$this->render('@backend/views/user/_menu.php',[ | |||||
$this->render('@backend/views/user/_menu_filter.php',[ | |||||
'section' => 'email', | 'section' => 'email', | ||||
'idPointSaleActive' => $idPointSaleActive, | 'idPointSaleActive' => $idPointSaleActive, | ||||
'sectionInactiveUsers' => isset($sectionInactiveUsers) ? $sectionInactiveUsers : null, | 'sectionInactiveUsers' => isset($sectionInactiveUsers) ? $sectionInactiveUsers : null, |
<div class="user-form" id="app-user-form"> | <div class="user-form" id="app-user-form"> | ||||
<div class="col-md-8"> | |||||
<?php $form = ActiveForm::begin([ | |||||
'enableClientValidation' => false | |||||
]); ?> | |||||
<?php $form = ActiveForm::begin([ | |||||
'enableClientValidation' => false | |||||
]); ?> | |||||
<div class="col-md-8 col-no-padding-left"> | |||||
<div class="panel panel-default"> | <div class="panel panel-default"> | ||||
<div class="panel-heading"> | <div class="panel-heading"> | ||||
<h3 class="panel-title"> | <h3 class="panel-title"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="panel panel-default panel-newsletter"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="fa fa-paper-plane"></i> | |||||
Bulletin d'information | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<?= $form->field($model, 'newsletter')->widget(Toggle::class, | |||||
[ | |||||
'options' => [ | |||||
'data-id' => $model->id, | |||||
'data-on' => 'Oui', | |||||
'data-off' => 'Non', | |||||
], | |||||
] | |||||
); ?> | |||||
</div> | |||||
</div> | |||||
<?php if ( | |||||
$distributionModule->getExportManager()->isEnabled(ExportManager::SHOPPING_CART_LABELS_PDF) | |||||
|| $producerModule->getSolver()->getConfig('option_export_evoliz')): ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="fa fa-download"></i> | |||||
Exports | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<?php if($distributionModule->getExportManager()->isEnabled(ExportManager::SHOPPING_CART_LABELS_PDF)): ?> | |||||
<?= $form->field($model, 'exclude_export_shopping_cart_labels')->checkbox(); ?> | |||||
<?php endif; ?> | |||||
<?php if ($producerModule->getSolver()->getConfig('option_export_evoliz')): ?> | |||||
<?= $form->field($model, 'evoliz_code')->textInput() ?> | |||||
<?php endif; ?> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php if($pointsSaleArray && count($pointsSaleArray) > 0): ?> | <?php if($pointsSaleArray && count($pointsSaleArray) > 0): ?> | ||||
<div class="panel panel-default panel-point-sales"> | <div class="panel panel-default panel-point-sales"> | ||||
<div class="panel-heading"> | <div class="panel-heading"> | ||||
<?= Html::submitButton($model->isNewRecord ? 'Créer' : 'Modifier', ['class' => 'btn btn-primary']) ?> | <?= Html::submitButton($model->isNewRecord ? 'Créer' : 'Modifier', ['class' => 'btn btn-primary']) ?> | ||||
</div> | </div> | ||||
<?php ActiveForm::end(); ?> | |||||
</div> | </div> | ||||
<div class="col-md-4"> | <div class="col-md-4"> | ||||
<?php if($model->email): ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="fa fa-envelope"></i> | |||||
Envoi d'emails | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<?php $form = ActiveForm::begin(); ?> | |||||
<div class="form-group"> | |||||
<?= Html::submitButton( | |||||
'<i class="fa fa-home"></i> Envoyer l\'email de bienvenue', | |||||
['class' => 'btn btn-default', 'name' => 'submit_mail_welcome', 'value' => 1] | |||||
) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
<?php $form = ActiveForm::begin(); ?> | |||||
<div class="form-group"> | |||||
<?= Html::submitButton( | |||||
'<i class="fa fa-key"></i> Envoyer un nouveau mot de passe', | |||||
['class' => 'btn btn-default', 'name' => 'submit_new_password', 'value' => 1] | |||||
) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
</div> | |||||
<div class="panel panel-default panel-newsletter"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="fa fa-paper-plane"></i> | |||||
Bulletin d'information | |||||
</h3> | |||||
</div> | </div> | ||||
<?php endif; ?> | |||||
<div class="panel-body"> | |||||
<?= $form->field($model, 'newsletter')->widget(Toggle::class, | |||||
[ | |||||
'options' => [ | |||||
'data-id' => $model->id, | |||||
'data-on' => 'Oui', | |||||
'data-off' => 'Non', | |||||
], | |||||
] | |||||
); ?> | |||||
</div> | |||||
</div> | |||||
<?php if(isset($pointSaleBillingArray) && $pointSaleBillingArray && count($pointSaleBillingArray) > 0): ?> | |||||
<?php if ( | |||||
$distributionModule->getExportManager()->isEnabled(ExportManager::SHOPPING_CART_LABELS_PDF) | |||||
|| $producerModule->getSolver()->getConfig('option_export_evoliz')): ?> | |||||
<div class="panel panel-default"> | <div class="panel panel-default"> | ||||
<div class="panel-heading"> | <div class="panel-heading"> | ||||
<h3 class="panel-title"> | <h3 class="panel-title"> | ||||
<i class="fa fa-sticky-note-o"></i> | |||||
Facturation | |||||
<i class="fa fa-download"></i> | |||||
Exports | |||||
</h3> | </h3> | ||||
</div> | </div> | ||||
<div class="panel-body"> | <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; ?> | |||||
<?php if($distributionModule->getExportManager()->isEnabled(ExportManager::SHOPPING_CART_LABELS_PDF)): ?> | |||||
<?= $form->field($model, 'exclude_export_shopping_cart_labels')->checkbox(); ?> | |||||
<?php endif; ?> | |||||
<?php if ($producerModule->getSolver()->getConfig('option_export_evoliz')): ?> | |||||
<?= $form->field($model, 'evoliz_code')->textInput() ?> | |||||
<?php endif; ?> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</div> | </div> | ||||
<?php ActiveForm::end(); ?> | |||||
</div> | </div> |
<?php | |||||
use domain\Order\Order\OrderModule; | |||||
use domain\User\User\User; | |||||
use domain\User\User\UserModule; | |||||
use common\helpers\Price; | |||||
$userModule = UserModule::getInstance(); | |||||
$orderModule = OrderModule::getInstance(); | |||||
$credit = $userModule->getRepository()->getCredit($user); | |||||
$countOrders = $orderModule->getRepository()->countOrdersByUser($user); | |||||
?> | |||||
<ul class="nav nav-tabs"> | |||||
<?= menu_navigation_item('view', 'Récapitulatif', $action, $user) ?> | |||||
<?= menu_navigation_item('update', 'Profil', $action, $user) ?> | |||||
<?= menu_navigation_item('credit', 'Crédit <span class="label label-default badge">'.Price::format($credit).'</span>', $action, $user) ?> | |||||
<?= menu_navigation_item('orders', 'Commandes <span class="label label-default badge">'.$countOrders.'</span>', $action, $user) ?> | |||||
</ul> | |||||
<?php | |||||
function menu_navigation_item(string $action, string $label, string $currentAction, User $user) { | |||||
$classActive = ($action == $currentAction) ? ' class="active"' : ''; | |||||
$url = Yii::$app->urlManager->createUrl(['user/'.$action, 'id' => $user->id]); | |||||
return '<li'.$classActive.'><a href="'.$url.'">'.$label.'</a></li>'; | |||||
} | |||||
?> |
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\helpers\MeanPayment; | use common\helpers\MeanPayment; | ||||
use domain\Payment\Payment; | use domain\Payment\Payment; | ||||
use domain\User\User\UserModule; | |||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\widgets\ActiveForm; | use yii\widgets\ActiveForm; | ||||
$producerModule = $this->getProducerModule(); | $producerModule = $this->getProducerModule(); | ||||
$userModule = $this->getUserModule(); | $userModule = $this->getUserModule(); | ||||
$this->setTitle('Créditer <small>'.Html::encode($user->lastname.' '.$user->name).'</small>', 'Créditer '.Html::encode($user->lastname.' '.$user->name)) ; | |||||
$userModule = UserModule::getInstance(); | |||||
$username = Html::encode($userModule->getSolver()->getUsername($user)); | |||||
$this->setTitle($username.' (#'.$user->id.')') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | $this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | ||||
$this->addBreadcrumb(['label' => Html::encode($user->lastname.' '.$user->name)]) ; | |||||
$this->addBreadcrumb('Créditer') ; | |||||
$this->addBreadcrumb(['label' => $username]) ; | |||||
$this->addBreadcrumb('Crédit') ; | |||||
?> | ?> | ||||
<div class="user-credit"> | |||||
<?= $this->render('_menu_navigation', [ | |||||
'action' => 'credit', | |||||
'user' => $user | |||||
]); ?> | |||||
<div class="user-credit tab-content"> | |||||
<?php | <?php | ||||
$producer = $producerModule->findOneProducerById(GlobalParam::getCurrentProducerId()); | $producer = $producerModule->findOneProducerById(GlobalParam::getCurrentProducerId()); | ||||
} | } | ||||
?> | ?> | ||||
<div class="col-md-4"> | |||||
<div class="col-md-4 col-no-padding-left"> | |||||
<div class="panel panel-default"> | <div class="panel panel-default"> | ||||
<div class="panel-heading"> | <div class="panel-heading"> | ||||
<h3 class="panel-title"> | <h3 class="panel-title"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="col-md-8"> | |||||
<div class="col-md-8 col-no-padding-right"> | |||||
<h2>Historique <span class="the-credit"><?= number_format($userModule->getCredit($user), 2); ?> €</span></h2> | <h2>Historique <span class="the-credit"><?= number_format($userModule->getCredit($user), 2); ?> €</span></h2> | ||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
], | ], | ||||
]); ?> | ]); ?> | ||||
</div> | </div> | ||||
<div class="clr"></div> | |||||
</div> | </div> |
<?= | <?= | ||||
$this->render('_menu', [ | |||||
$this->render('_menu_filter', [ | |||||
'idPointSaleActive' => $idPointSaleActive, | 'idPointSaleActive' => $idPointSaleActive, | ||||
'idDistributionActive' => 0, | 'idDistributionActive' => 0, | ||||
'sectionInactiveUsers' => $sectionInactiveUsers, | 'sectionInactiveUsers' => $sectionInactiveUsers, | ||||
], | ], | ||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{update} {delete} {switch}', | |||||
'template' => '{view} {update} {delete} {switch}', | |||||
'headerOptions' => ['class' => 'column-actions'], | 'headerOptions' => ['class' => 'column-actions'], | ||||
'contentOptions' => ['class' => 'column-actions'], | 'contentOptions' => ['class' => 'column-actions'], | ||||
'buttons' => [ | 'buttons' => [ | ||||
'view' => function ($url, $user) { | |||||
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', | |||||
Yii::$app->urlManager->createUrl(['user/view', 'id' => $user->id]), | |||||
[ | |||||
'title' => 'Voir', | |||||
'class' => 'btn btn-default' | |||||
]); | |||||
}, | |||||
'update' => function ($url, $user) { | 'update' => function ($url, $user) { | ||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', | ||||
Yii::$app->urlManager->createUrl(['user/update', 'id' => $user->id]), | Yii::$app->urlManager->createUrl(['user/update', 'id' => $user->id]), |
* termes. | * termes. | ||||
*/ | */ | ||||
use domain\User\User\UserModule; | |||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$userModule = $this->getUserModule(); | $userModule = $this->getUserModule(); | ||||
$orderModule = $this->getOrderModule(); | $orderModule = $this->getOrderModule(); | ||||
$this->setTitle('Commandes <small>' . Html::encode($userModule->getUsername($user)) . '</small>', 'Commandes de ' . Html::encode($userModule->getUsername($user))); | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]); | |||||
$this->addBreadcrumb(['label' => Html::encode($user->lastname . ' ' . $user->name)]); | |||||
$this->addBreadcrumb('Commandes'); | |||||
$userModule = UserModule::getInstance(); | |||||
$username = Html::encode($userModule->getSolver()->getUsername($user)); | |||||
$this->setTitle($username.' (#'.$user->id.')') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => $username]) ; | |||||
$this->addBreadcrumb('Commandes') ; | |||||
?> | ?> | ||||
<div class="user-orders"> | |||||
<?= $this->render('_menu_navigation', [ | |||||
'action' => 'orders', | |||||
'user' => $user | |||||
]); ?> | |||||
<div class="user-orders tab-content"> | |||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'filterModel' => $searchModel, | 'filterModel' => $searchModel, | ||||
'dataProvider' => $dataProvider, | 'dataProvider' => $dataProvider, |
termes. | termes. | ||||
*/ | */ | ||||
use domain\User\User\UserModule; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$this->setTitle('Modifier un client (#'.$model->id.')') ; | |||||
$userModule = UserModule::getInstance(); | |||||
$username = Html::encode($userModule->getSolver()->getUsername($model)); | |||||
$this->setTitle($username.' (#'.$model->id.')') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | $this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | ||||
$this->addBreadcrumb(['label' => Html::encode($model->lastname.' '.$model->name)]) ; | |||||
$this->addBreadcrumb(['label' => $username]) ; | |||||
$this->addBreadcrumb('Modifier') ; | $this->addBreadcrumb('Modifier') ; | ||||
?> | ?> | ||||
<div class="user-update"> | |||||
<?= $this->render('_menu_navigation', [ | |||||
'action' => 'update', | |||||
'user' => $model | |||||
]); ?> | |||||
<div class="user-update tab-content"> | |||||
<?= $this->render('_form', [ | <?= $this->render('_form', [ | ||||
'model' => $model, | 'model' => $model, | ||||
'pointsSaleArray' => $pointsSaleArray, | 'pointsSaleArray' => $pointsSaleArray, | ||||
'userGroupsArray' => $userGroupsArray, | 'userGroupsArray' => $userGroupsArray, | ||||
'pointSaleBillingArray' => $pointSaleBillingArray | 'pointSaleBillingArray' => $pointSaleBillingArray | ||||
]) ?> | ]) ?> | ||||
<div class="clr"></div> | |||||
</div> | </div> |
<?php | |||||
/** | |||||
Copyright distrib (2018) | |||||
contact@opendistrib.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
use common\helpers\Price; | |||||
use domain\User\User\UserModule; | |||||
use yii\helpers\Html; | |||||
use yii\widgets\ActiveForm; | |||||
$userModule = UserModule::getInstance(); | |||||
$username = Html::encode($userModule->getSolver()->getUsername($model)); | |||||
$this->setTitle($username.' (#'.$model->id.')') ; | |||||
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => $username]) ; | |||||
$this->addBreadcrumb('Récapitulatif') ; | |||||
?> | |||||
<?= $this->render('_menu_navigation', [ | |||||
'action' => 'view', | |||||
'user' => $model | |||||
]); ?> | |||||
<div class="user-view tab-content"> | |||||
<div class="col-md-6 col-no-padding-left"> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="fa fa-user"></i> | |||||
Profil | |||||
<a class="btn btn-default btn-xs" href="<?= Yii::$app->urlManager->createUrl(['user/update','id' => $model->id]) ?>"> | |||||
<span class="glyphicon glyphicon-pencil"></span> | |||||
Modifier | |||||
</a> | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<ul class="list-group list-group-unbordered"> | |||||
<li class="list-group-item"> | |||||
<strong>Type</strong> | |||||
<span class="pull-right"> | |||||
<?= $userModule->getSolver()->getTypeLabel($model->type) ?> | |||||
</span> | |||||
</li> | |||||
<li class="list-group-item"> | |||||
<strong>Nom</strong> | |||||
<span class="pull-right"> | |||||
<?= $userModule->getSolver()->getUsername($model) ?> | |||||
</span> | |||||
</li> | |||||
<?php if($model->phone): ?> | |||||
<li class="list-group-item"> | |||||
<strong>Téléphone</strong> | |||||
<span class="pull-right"> | |||||
<span class="glyphicon glyphicon-phone"></span> | |||||
<?= $model->phone ?> | |||||
</span> | |||||
</li> | |||||
<?php endif; ?> | |||||
<?php if($model->email): ?> | |||||
<li class="list-group-item"> | |||||
<strong>Email</strong> | |||||
<span class="pull-right"> | |||||
<span class="glyphicon glyphicon-envelope"></span> | |||||
<a href="mailto:<?= $model->email ?>"><?= $model->email ?></a> | |||||
</span> | |||||
</li> | |||||
<?php endif; ?> | |||||
<?php if($model->address): ?> | |||||
<li class="list-group-item"> | |||||
<strong>Adresse</strong> | |||||
<span class="pull-right"> | |||||
<?= $model->address ?> | |||||
</span> | |||||
</li> | |||||
<?php endif; ?> | |||||
<li class="list-group-item"> | |||||
<strong>Bulletin d'information</strong> | |||||
<span class="pull-right"> | |||||
<?php $isUserSubscribedNewsletter = $userModule->getNewsletterManager()->isUserSubscribedNewsletter($model); ?> | |||||
<span class="label label-<?= $isUserSubscribedNewsletter ? 'success' : 'default' ?>"> | |||||
<?= $isUserSubscribedNewsletter ? 'Oui' : 'Non' ?> | |||||
</span> | |||||
</span> | |||||
</li> | |||||
<?php if($model->userPointSale): ?> | |||||
<li class="list-group-item"> | |||||
<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 endforeach; ?> | |||||
</span> | |||||
</li> | |||||
<?php endif; ?> | |||||
<?php if($model->userUserGroup): ?> | |||||
<li class="list-group-item"> | |||||
<strong>Groupes d'utilisateurs</strong> | |||||
<span class="pull-right"> | |||||
<?php foreach($model->userUserGroup as $userUserGroup): ?> | |||||
<span class="label label-default"><?= $userUserGroup->userGroup->name; ?></span> | |||||
<?php endforeach; ?> | |||||
</span> | |||||
</li> | |||||
<?php endif; ?> | |||||
</ul> | |||||
</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; ?> | |||||
<?php if($model->email): ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="fa fa-envelope"></i> | |||||
Emails accès | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<?php $form = ActiveForm::begin(); ?> | |||||
<div class="form-group"> | |||||
<?= Html::submitButton( | |||||
'<i class="fa fa-key"></i> Envoyer un nouveau mot de passe', | |||||
['class' => 'btn btn-default', 'name' => 'submit_new_password', 'value' => 1] | |||||
) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
<?php $form = ActiveForm::begin(); ?> | |||||
<div class="form-group"> | |||||
<?= Html::submitButton( | |||||
'<i class="fa fa-home"></i> Envoyer l\'email de bienvenue', | |||||
['class' => 'btn btn-default', 'name' => 'submit_mail_welcome', 'value' => 1] | |||||
) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
</div> | |||||
<div class="col-md-6 col-no-padding-right"> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
<i class="glyphicon glyphicon-piggy-bank"></i> | |||||
Crédit | |||||
<a class="btn btn-default btn-xs" href="<?= Yii::$app->urlManager->createUrl(['user/credit','id' => $model->id]) ?>"> | |||||
<span class="glyphicon glyphicon-euro"></span> | |||||
Voir / créditer | |||||
</a> | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<ul class="list-group list-group-unbordered"> | |||||
<li class="list-group-item"> | |||||
<strong>Montant</strong> | |||||
<span class="pull-right"> | |||||
<?php $credit = $userModule->getRepository()->getCredit($model); ?> | |||||
<span class="label label-<?= $credit > 0 ? 'success' : 'danger' ?>"> | |||||
<?= Price::format($credit) ?> | |||||
</span> | |||||
</span> | |||||
</li> | |||||
<li class="list-group-item"> | |||||
<strong>Crédit obligatoire</strong> | |||||
<span class="pull-right"> | |||||
<?php $creditActive = $userModule->getRepository()->getCreditActive($model) ?> | |||||
<span class="label label-<?= $creditActive ? 'success' : 'default' ?>"> | |||||
<?= $creditActive ? 'Oui' : 'Non' ?> | |||||
</span> | |||||
</span> | |||||
</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="clr"></div> | |||||
</div> |
font-size: 20px; | font-size: 20px; | ||||
} | } | ||||
/* line 220, ../sass/_adminlte.scss */ | /* line 220, ../sass/_adminlte.scss */ | ||||
body.skin-black .content-wrapper .col-no-padding-left { | |||||
padding-left: 0px; | |||||
} | |||||
/* line 224, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .col-no-padding-right { | |||||
padding-right: 0px; | |||||
} | |||||
/* line 228, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper a { | body.skin-black .content-wrapper a { | ||||
color: #e08e0b; | color: #e08e0b; | ||||
} | } | ||||
/* line 224, ../sass/_adminlte.scss */ | |||||
/* line 232, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .label { | |||||
padding-top: 4px; | |||||
padding-bottom: 1px; | |||||
} | |||||
/* line 237, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .btn { | body.skin-black .content-wrapper .btn { | ||||
color: white; | color: white; | ||||
} | } | ||||
/* line 228, ../sass/_adminlte.scss */ | |||||
/* line 241, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .btn-default { | body.skin-black .content-wrapper .btn-default { | ||||
color: #333; | color: #333; | ||||
background-color: white; | background-color: white; | ||||
} | } | ||||
/* line 233, ../sass/_adminlte.scss */ | |||||
/* line 246, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .btn-primary { | body.skin-black .content-wrapper .btn-primary { | ||||
background-color: #F39C12; | background-color: #F39C12; | ||||
color: white; | color: white; | ||||
border-color: #F39C12; | border-color: #F39C12; | ||||
} | } | ||||
/* line 240, ../sass/_adminlte.scss */ | |||||
/* line 253, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .nav.nav-tabs .badge { | |||||
margin-left: 4px; | |||||
background-color: #e0e0e0; | |||||
color: #444; | |||||
} | |||||
/* line 260, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .tab-content { | |||||
border-left: solid 1px #ddd; | |||||
border-bottom: solid 1px #ddd; | |||||
border-right: solid 1px #ddd; | |||||
padding: 30px 15px 15px 15px; | |||||
background-color: white; | |||||
} | |||||
/* line 268, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .alert { | |||||
position: relative; | |||||
} | |||||
/* line 271, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .alert a { | body.skin-black .content-wrapper .alert a { | ||||
color: white; | color: white; | ||||
} | } | ||||
/* line 243, ../sass/_adminlte.scss */ | |||||
/* line 274, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .alert a.btn { | body.skin-black .content-wrapper .alert a.btn { | ||||
color: #333; | color: #333; | ||||
text-decoration: none; | text-decoration: none; | ||||
} | } | ||||
/* line 248, ../sass/_adminlte.scss */ | |||||
/* line 279, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .alert .close { | body.skin-black .content-wrapper .alert .close { | ||||
font-size: 30px; | font-size: 30px; | ||||
position: relative; | |||||
top: -25px; | |||||
position: absolute; | |||||
top: 10px; | |||||
right: 15px; | |||||
text-decoration: none; | text-decoration: none; | ||||
color: white; | color: white; | ||||
opacity: 0.6; | opacity: 0.6; | ||||
} | } | ||||
/* line 256, ../sass/_adminlte.scss */ | |||||
/* line 288, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .alert .close:hover { | body.skin-black .content-wrapper .alert .close:hover { | ||||
opacity: 1; | opacity: 1; | ||||
} | } | ||||
/* line 263, ../sass/_adminlte.scss */ | |||||
/* line 295, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .callout h4 .fa { | body.skin-black .content-wrapper .callout h4 .fa { | ||||
margin-right: 7px; | margin-right: 7px; | ||||
} | } | ||||
/* line 266, ../sass/_adminlte.scss */ | |||||
/* line 298, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .callout a { | body.skin-black .content-wrapper .callout a { | ||||
color: white; | color: white; | ||||
} | } | ||||
/* line 269, ../sass/_adminlte.scss */ | |||||
/* line 301, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .callout .btn { | body.skin-black .content-wrapper .callout .btn { | ||||
color: #333; | color: #333; | ||||
text-decoration: none; | text-decoration: none; | ||||
} | } | ||||
/* line 276, ../sass/_adminlte.scss */ | |||||
/* line 308, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .table th { | body.skin-black .content-wrapper .table th { | ||||
font-size: 13px; | font-size: 13px; | ||||
} | } | ||||
/* line 279, ../sass/_adminlte.scss */ | |||||
/* line 311, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions { | body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions { | ||||
width: 172px; | width: 172px; | ||||
text-align: right; | text-align: right; | ||||
} | } | ||||
/* line 283, ../sass/_adminlte.scss */ | |||||
/* line 315, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small { | body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small { | ||||
font-size: 12px; | font-size: 12px; | ||||
} | } | ||||
/* line 288, ../sass/_adminlte.scss */ | |||||
/* line 320, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .pagination > .active > a, body.skin-black .content-wrapper .pagination > .active > span, body.skin-black .content-wrapper .pagination > .active > a:hover, body.skin-black .content-wrapper .pagination > .active > span:hover, body.skin-black .content-wrapper .pagination > .active > a:focus, body.skin-black .content-wrapper .pagination > .active > span:focus { | body.skin-black .content-wrapper .pagination > .active > a, body.skin-black .content-wrapper .pagination > .active > span, body.skin-black .content-wrapper .pagination > .active > a:hover, body.skin-black .content-wrapper .pagination > .active > span:hover, body.skin-black .content-wrapper .pagination > .active > a:focus, body.skin-black .content-wrapper .pagination > .active > span:focus { | ||||
background-color: #F39C12; | background-color: #F39C12; | ||||
border: solid 1px #F39C12; | border: solid 1px #F39C12; | ||||
color: white; | color: white; | ||||
} | } | ||||
/* line 294, ../sass/_adminlte.scss */ | |||||
/* line 326, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span { | body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span { | ||||
color: #F39C12; | color: #F39C12; | ||||
} | } | ||||
/* line 296, ../sass/_adminlte.scss */ | |||||
/* line 328, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover { | body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover { | ||||
color: #c87f0a; | color: #c87f0a; | ||||
} | } | ||||
/* line 301, ../sass/_adminlte.scss */ | |||||
/* line 333, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .submenu { | body.skin-black .content-wrapper .submenu { | ||||
margin-bottom: 25px; | margin-bottom: 25px; | ||||
} | } | ||||
/* line 305, ../sass/_adminlte.scss */ | |||||
/* line 337, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .form-actions { | body.skin-black .content-wrapper .form-actions { | ||||
position: fixed; | position: fixed; | ||||
bottom: 0; | bottom: 0; | ||||
z-index: 10; | z-index: 10; | ||||
border-top: solid 1px #e0e0e0; | border-top: solid 1px #e0e0e0; | ||||
} | } | ||||
/* line 318, ../sass/_adminlte.scss */ | |||||
/* line 350, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .form-actions a, body.skin-black .content-wrapper .form-actions button { | body.skin-black .content-wrapper .form-actions a, body.skin-black .content-wrapper .form-actions button { | ||||
margin-left: 10px; | margin-left: 10px; | ||||
} | } | ||||
/* line 323, ../sass/_adminlte.scss */ | |||||
/* line 355, ../sass/_adminlte.scss */ | |||||
body.skin-black .content-wrapper .form-buttons { | body.skin-black .content-wrapper .form-buttons { | ||||
margin-top: 25px; | margin-top: 25px; | ||||
text-align: right; | text-align: right; | ||||
} | } | ||||
/* line 330, ../sass/_adminlte.scss */ | |||||
/* line 362, ../sass/_adminlte.scss */ | |||||
body.skin-black .main-footer a { | body.skin-black .main-footer a { | ||||
color: #F39C12; | color: #F39C12; | ||||
} | } | ||||
/* line 335, ../sass/_adminlte.scss */ | |||||
/* line 367, ../sass/_adminlte.scss */ | |||||
body.skin-black .gridview-pagesize { | body.skin-black .gridview-pagesize { | ||||
float: right; | float: right; | ||||
margin-bottom: 8px; | margin-bottom: 8px; | ||||
} | } | ||||
/* line 340, ../sass/_adminlte.scss */ | |||||
/* line 372, ../sass/_adminlte.scss */ | |||||
body.skin-black #yii-debug-toolbar { | body.skin-black #yii-debug-toolbar { | ||||
bottom: 64px; | bottom: 64px; | ||||
} | } | ||||
/* line 345, ../sass/_adminlte.scss */ | |||||
/* line 377, ../sass/_adminlte.scss */ | |||||
body.login-page { | body.login-page { | ||||
background: none; | background: none; | ||||
background-color: white; | background-color: white; | ||||
} | } | ||||
/* line 349, ../sass/_adminlte.scss */ | |||||
/* line 381, ../sass/_adminlte.scss */ | |||||
body.login-page .login-box .login-logo { | body.login-page .login-box .login-logo { | ||||
text-align: center; | text-align: center; | ||||
font-family: 'highvoltageregular'; | font-family: 'highvoltageregular'; | ||||
} | } | ||||
/* line 353, ../sass/_adminlte.scss */ | |||||
/* line 385, ../sass/_adminlte.scss */ | |||||
body.login-page .login-box .login-logo img { | body.login-page .login-box .login-logo img { | ||||
width: 50px; | width: 50px; | ||||
} | } | ||||
/* line 358, ../sass/_adminlte.scss */ | |||||
/* line 390, ../sass/_adminlte.scss */ | |||||
body.login-page .login-box .login-box-body .btn-primary { | body.login-page .login-box .login-box-body .btn-primary { | ||||
background-color: #F39C12; | background-color: #F39C12; | ||||
border-color: #F39C12; | border-color: #F39C12; | ||||
padding: 5px 10px; | padding: 5px 10px; | ||||
} | } | ||||
/* line 363, ../sass/_adminlte.scss */ | |||||
/* line 395, ../sass/_adminlte.scss */ | |||||
body.login-page .login-box .login-box-body .btn-primary:active { | body.login-page .login-box .login-box-body .btn-primary:active { | ||||
background-color: #f4a62a; | background-color: #f4a62a; | ||||
border-color: #F39C12; | border-color: #F39C12; | ||||
} | } | ||||
/* line 369, ../sass/_adminlte.scss */ | |||||
/* line 401, ../sass/_adminlte.scss */ | |||||
body.login-page .login-box .login-box-body a { | body.login-page .login-box .login-box-body a { | ||||
color: #F39C12; | color: #F39C12; | ||||
} | } | ||||
/* line 371, ../sass/_adminlte.scss */ | |||||
/* line 403, ../sass/_adminlte.scss */ | |||||
body.login-page .login-box .login-box-body a:hover { | body.login-page .login-box .login-box-body a:hover { | ||||
color: #f4a62a; | color: #f4a62a; | ||||
} | } |
} | } | ||||
} | } | ||||
.col-no-padding-left { | |||||
padding-left: 0px; | |||||
} | |||||
.col-no-padding-right { | |||||
padding-right: 0px; | |||||
} | |||||
a { | a { | ||||
color: darken($color1, 5) ; | color: darken($color1, 5) ; | ||||
} | } | ||||
.label { | |||||
padding-top: 4px; | |||||
padding-bottom: 1px; | |||||
} | |||||
.btn { | .btn { | ||||
color: white ; | color: white ; | ||||
color: white ; | color: white ; | ||||
border-color: $color1 ; | border-color: $color1 ; | ||||
} | } | ||||
.nav.nav-tabs { | |||||
.badge { | |||||
margin-left: 4px; | |||||
background-color: #e0e0e0; | |||||
color: #444; | |||||
} | |||||
} | |||||
.tab-content { | |||||
border-left: solid 1px #ddd; | |||||
border-bottom: solid 1px #ddd; | |||||
border-right: solid 1px #ddd; | |||||
padding: 30px 15px 15px 15px; | |||||
background-color: white; | |||||
} | |||||
.alert { | .alert { | ||||
position: relative; | |||||
a { | a { | ||||
color: white ; | color: white ; | ||||
} | } | ||||
.close { | .close { | ||||
font-size: 30px; | font-size: 30px; | ||||
position: relative; | |||||
top: -25px; | |||||
position: absolute; | |||||
top: 10px; | |||||
right: 15px; | |||||
text-decoration: none; | text-decoration: none; | ||||
color: white; | color: white; | ||||
opacity: 0.6; | opacity: 0.6; |
return $ordersArray; | return $ordersArray; | ||||
} | } | ||||
public function countOrdersByUser(User $user) | |||||
{ | |||||
return Order::searchCount([ | |||||
'id_user' => $user->id, | |||||
], ['conditions' => 'date_delete IS NULL']); | |||||
} | |||||
} | } |
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
use domain\Order\Order\Order; | use domain\Order\Order\Order; | ||||
use domain\PointSale\UserPointSale\UserPointSale; | |||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use domain\User\UserProducer\UserProducer; | use domain\User\UserProducer\UserProducer; | ||||
use domain\User\UserUserGroup\UserUserGroup; | use domain\User\UserUserGroup\UserUserGroup; | ||||
return $this->hasMany(UserProducer::class, ['id_user' => 'id']); | return $this->hasMany(UserProducer::class, ['id_user' => 'id']); | ||||
} | } | ||||
public function getUserPointSale() | |||||
{ | |||||
return $this->hasMany(UserPointSale::class, ['id_user' => 'id']); | |||||
} | |||||
public function getUserUserGroup() | public function getUserUserGroup() | ||||
{ | { | ||||
return $this->hasMany(UserUserGroup::class, ['id_user' => 'id']); | return $this->hasMany(UserUserGroup::class, ['id_user' => 'id']); |