Przeglądaj źródła

Adaptations header-content (title, buttons, breadcrumb)

dev
Guillaume Bourgeois 6 lat temu
rodzic
commit
3cd7e33fac
36 zmienionych plików z 186 dodań i 241 usunięć
  1. +4
    -1
      backend/config/main.php
  2. +1
    -1
      backend/controllers/PointSaleController.php
  3. +2
    -2
      backend/controllers/UserController.php
  4. +4
    -4
      backend/models/CreditForm.php
  5. +2
    -9
      backend/views/communicate/index.php
  6. +4
    -10
      backend/views/development/create.php
  7. +5
    -14
      backend/views/development/index.php
  8. +5
    -10
      backend/views/development/update.php
  9. +9
    -1
      backend/views/layouts/content.php
  10. +1
    -1
      backend/views/layouts/left.php
  11. +4
    -9
      backend/views/point-sale/create.php
  12. +4
    -8
      backend/views/point-sale/index.php
  13. +5
    -10
      backend/views/point-sale/update.php
  14. +2
    -5
      backend/views/producer-admin/index.php
  15. +4
    -7
      backend/views/producer/billing.php
  16. +3
    -5
      backend/views/producer/update.php
  17. +4
    -10
      backend/views/product/create.php
  18. +4
    -8
      backend/views/product/index.php
  19. +6
    -10
      backend/views/product/update.php
  20. +2
    -5
      backend/views/stats/index.php
  21. +4
    -9
      backend/views/stats/products.php
  22. +4
    -9
      backend/views/subscription/create.php
  23. +5
    -7
      backend/views/subscription/index.php
  24. +4
    -8
      backend/views/subscription/update.php
  25. +4
    -7
      backend/views/user/create.php
  26. +9
    -10
      backend/views/user/credit.php
  27. +4
    -6
      backend/views/user/emails.php
  28. +3
    -10
      backend/views/user/index.php
  29. +13
    -16
      backend/views/user/orders.php
  30. +5
    -10
      backend/views/user/update.php
  31. +23
    -12
      backend/web/css/screen.css
  32. +13
    -1
      backend/web/sass/_adminlte.scss
  33. +15
    -3
      common/components/MyView.php
  34. +2
    -2
      common/models/CreditHistory.php
  35. +1
    -1
      common/models/Order.php
  36. +2
    -0
      common/models/User.php

+ 4
- 1
backend/config/main.php Wyświetl plik

@@ -66,13 +66,16 @@ return [
'errorAction' => 'site/error',
],
'urlManager' => $common_config_main['components']['urlManagerBackend'],
'assetManager' => [
'assetManager' => [
'bundles' => [
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-black',
],
],
],
'view' => [
'class' => 'common\components\MyView',
],
],
'params' => $params,
];

+ 1
- 1
backend/controllers/PointSaleController.php Wyświetl plik

@@ -107,7 +107,7 @@ class PointSaleController extends BackendController
$model->processRestrictedAccess();
return $this->redirect(['index']);
} else {
return $this->render('update', array_merge($this->initForm(), [
return $this->render('create', array_merge($this->initForm(), [
'model' => $model,
]));
}

+ 2
- 2
backend/controllers/UserController.php Wyświetl plik

@@ -295,11 +295,11 @@ class UserController extends BackendController
{
$user = User::findOne($id);

$orders = Order::searchAll([
$ordersArray = Order::searchAll([
'id_user' => $id
], ['orderby' => 'distribution.date DESC']) ;

return $this->render('commandes', [
return $this->render('orders', [
'ordersArray' => $ordersArray,
'user' => $user
]);

+ 4
- 4
backend/models/CreditForm.php Wyświetl plik

@@ -57,7 +57,7 @@ class CreditForm extends Model
public $id_producer ;
public $type ;
public $amount ;
public $means_payment ;
public $mean_payment ;
public $comment ;
public $send_mail ;

@@ -71,7 +71,7 @@ class CreditForm extends Model
[['id_user', 'id_user_action', 'id_producer'], 'integer'],
[['date','send_mail'], 'safe'],
[['amount'], 'double'],
[['type', 'means_payment', 'comment'], 'string', 'max' => 255],
[['type', 'mean_payment', 'comment'], 'string', 'max' => 255],
];
}

@@ -87,7 +87,7 @@ class CreditForm extends Model
'amount' => 'Montant',
'type' => 'Type',
'id_producer' => 'Producteur',
'means_payment' => 'Moyen de paiement',
'mean_payment' => 'Moyen de paiement',
'comment' => 'Commentaire',
'send_mail' => 'Prévenir l\'utilisateur',
];
@@ -106,7 +106,7 @@ class CreditForm extends Model
$creditHistory->type = $this->type ;
$creditHistory->comment = $this->comment ;
$creditHistory->amount = $this->amount ;
$creditHistory->means_payment = $this->means_payment ;
$creditHistory->mean_payment = $this->mean_payment ;
$creditHistory->save();
// on prévient l'utilisateur que son compte vient d'être crédité

+ 2
- 9
backend/views/communicate/index.php Wyświetl plik

@@ -38,18 +38,11 @@ termes.

use yii\helpers\Html ;

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

$this->title = 'Communiquer' ;
$this->setTitle('Communiquer') ;
$this->addBreadcrumb('Communiquer') ;

?>

<h1><?= Html::encode($this->title) ; ?></h1>

<p>Imprimez ce petit encart pour expliquer à vos clients comment passer leurs commandes.</p>
<?php echo $this->render('instructions', ['producer' => $producer]) ; ?>
<p><?php echo Html::a('<span class="glyphicon glyphicon-download-alt"></span> Télécharger', ['communicate/instructions'], ['class'=>'btn btn-primary']) ?></p>

+ 4
- 10
backend/views/development/create.php Wyświetl plik

@@ -38,20 +38,14 @@ termes.

use yii\helpers\Html;

$this->setTitle('Ajouter un développement') ;
$this->addBreadcrumb(['label' => 'Développement', 'url' => ['index']]) ;
$this->addBreadcrumb('Ajouter') ;

/* @var $this yii\web\View */
/* @var $model common\models\Developpement */

$this->title = 'Ajouter un développement';
$this->params['breadcrumbs'][] = ['label' => 'Développement', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="development-create">

<h1><?= Html::encode($this->title) ?></h1>

<div class="development-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>

</div>

+ 5
- 14
backend/views/development/index.php Wyświetl plik

@@ -43,27 +43,18 @@ use common\models\DevelopmentPriority;
use common\models\User;
use common\helpers\Url;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->setTitle('Développement') ;
$this->addButton(['label' => 'Ajouter', 'url' => ['development/create'], 'class' => 'btn btn-primary']) ;
$this->addBreadcrumb($this->getTitle()) ;

$this->title = 'Développement';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="development-index">

<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>
<div class="development-index">
<div class="well">
Cette page liste les besoins recencés auprès des producteurs utilisant la plateforme. N'hésitez pas à me <a href="<?= Url::frontend('site/contact') ?>">contacter</a> pour la faire évoluer. Les remontées de bugs sont également bienvenues.<br />
Cette page liste les besoins recencés auprès des producteurs utilisant la plateforme. N'hésitez pas à me <a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/contact']) ; ?>">contacter</a> pour la faire évoluer. Les remontées de bugs sont également bienvenues.<br />
Afin d'orienter de manière pertinente le développement de la plateforme, je vous invite à définir la priorité des évolutions qui vous intéressent.
</div>
<?php
foreach (Yii::$app->session->getAllFlashes() as $key => $message) {
echo '<div class="alert alert-' . $key . '">' . $message . '</div>';
}
?>
<ul id="tab-status-developments" class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?php if($status == Development::STATUS_OPEN): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_OPEN]); ?>" id="" aria-controls="" role="tab">Ouvert</a></li>
<li role="presentation" class="<?php if($status == Development::STATUS_CLOSED): ?>active<?php endif; ?>"><a href="<?= Yii::$app->urlManager->createUrl(['development/index','status' => Development::STATUS_CLOSED]); ?>" id="" aria-controls="" role="tab">Fermé</a></li>

+ 5
- 10
backend/views/development/update.php Wyświetl plik

@@ -38,20 +38,15 @@ termes.

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model common\models\Developpement */
$this->setTitle('Modifier un développement') ;
$this->addBreadcrumb(['label' => 'Développement', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => '#'.$model->id, 'url' => ['update', 'id' => $model->id]]) ;
$this->addBreadcrumb('Modifier') ;

$this->title = 'Modifier un développement';
$this->params['breadcrumbs'][] = ['label' => 'Développement', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => '#'.$model->id, 'url' => ['update', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Modifier';
?>
<div class="development-update">

<h1><?= Html::encode($this->title) ?></h1>

<div class="development-update">
<?= $this->render('_form', [
'model' => $model,
]) ?>

</div>

+ 9
- 1
backend/views/layouts/content.php Wyświetl plik

@@ -48,13 +48,21 @@ use dmstr\widgets\Alert;
<h1>
<?php
if ($this->title !== null) {
echo \yii\helpers\Html::encode($this->title);
echo $this->title;
} else {
echo \yii\helpers\Inflector::camel2words(
\yii\helpers\Inflector::id2camel($this->context->module->id)
);
echo ($this->context->module->id !== \Yii::$app->id) ? '<small>Module</small>' : '';
} ?>
<?php
if(count($this->buttons)) {
foreach($this->buttons as $button) {
echo '<a href="'.Yii::$app->urlManagerBackend->createUrl($button['url']).'" class="'.$button['class'].'">'.$button['label'].'</a>' ;
}
}
?>
</h1>
<?php } ?>


+ 1
- 1
backend/views/layouts/left.php Wyświetl plik

@@ -51,7 +51,7 @@ termes.
['label' => 'Abonnements','icon' => 'repeat','url' => ['/subscription/index'], 'visible' => User::isCurrentProducer()],
['label' => 'Produits','icon' => 'clone','url' => ['/product/index'], 'visible' => User::isCurrentProducer()],
['label' => 'Points de vente','icon' => 'map-marker','url' => ['/point-sale/index'], 'visible' => User::isCurrentProducer()],
['label' => 'Clients','icon' => 'users','url' => ['/user/index'], 'visible' => User::isCurrentProducer()],
['label' => 'Utilisateurs','icon' => 'users','url' => ['/user/index'], 'visible' => User::isCurrentProducer()],
['label' => 'Paramètres','icon' => 'cog','url' => ['/producer/update'], 'visible' => User::isCurrentProducer()],
['label' => 'Communiquer','icon' => 'bullhorn','url' => ['/communicate/index'], 'visible' => User::isCurrentProducer()],
[

+ 4
- 9
backend/views/point-sale/create.php Wyświetl plik

@@ -39,20 +39,15 @@ termes.
use yii\helpers\Html;


/* @var $this yii\web\View */
/* @var $model backend\models\PointVente */
$this->setTitle('Ajouter un point de vente') ;
$this->addBreadcrumb(['label' => 'Points de vente', 'url' => ['index']]) ;
$this->addBreadcrumb('Ajouter') ;

$this->title = 'Ajouter un point de vente';
$this->params['breadcrumbs'][] = ['label' => 'Points de vente', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Ajouter';
?>
<div class="point-sale-create">

<h1><?= Html::encode($this->title) ?></h1>

<div class="point-sale-create">
<?= $this->render('_form', [
'model' => $model,
'users' => $users,
]) ?>

</div>

+ 4
- 8
backend/views/point-sale/index.php Wyświetl plik

@@ -40,16 +40,13 @@ use yii\helpers\Html;
use yii\grid\GridView;
use common\models\PointVenteUser ;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->setTitle('Points de vente') ;
$this->addBreadcrumb($this->getTitle()) ;
$this->addButton(['label' => 'Ajouter', 'url' => 'point-sale/create', 'class' => 'btn btn-primary']) ;

$this->title = 'Points de vente';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="point-sale-index">

<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>

<div class="point-sale-index">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
@@ -134,5 +131,4 @@ $this->params['breadcrumbs'][] = $this->title;
],
],
]); ?>

</div>

+ 5
- 10
backend/views/point-sale/update.php Wyświetl plik

@@ -38,21 +38,16 @@ termes.

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model backend\models\PointVente */
$this->setTitle('Modifier un point de vente') ;
$this->addBreadcrumb(['label' => 'Points de vente', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => Html::encode($model->name), 'url' => ['update', 'id' => $model->id]]) ;
$this->addBreadcrumb('Modifier') ;

$this->title = 'Modifier un point de vente';
$this->params['breadcrumbs'][] = ['label' => 'Points de vente', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => Html::encode($model->name), 'url' => ['update', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Modifier';
?>
<div class="point-sale-update">

<h1><?= Html::encode($this->title) ?></h1>

<div class="point-sale-update">
<?= $this->render('_form', [
'model' => $model,
'users' => $users
]) ?>

</div>

+ 2
- 5
backend/views/producer-admin/index.php Wyświetl plik

@@ -41,14 +41,11 @@ use yii\grid\GridView;
use common\models\User ;
use common\models\Producer ;

$this->title = 'Producteurs';
$this->params['breadcrumbs'][] = 'Administration' ;
$this->params['breadcrumbs'][] = $this->title;
$this->setTitle('Producteurs') ;
$this->addBreadcrumb($this->getTitle()) ;

?>

<h1>Producteurs</h1>

<?= GridView::widget([
'dataProvider' => $dataProviderProducer,
'columns' => [

+ 4
- 7
backend/views/producer/billing.php Wyświetl plik

@@ -42,18 +42,15 @@ use common\models\User ;
use common\models\Producer ;
use yii\bootstrap\ActiveForm;

$this->title = 'Mon abonnement';
$this->params['breadcrumbs'][] = 'Administration' ;
$this->params['breadcrumbs'][] = $this->title;
$this->setTitle('Mon abonnement') ;
$this->addBreadcrumb($this->getTitle()) ;

?>

<h1>Mon abonnement</h1>

<p class="">
<div class="well">
Vous seuls savez ce que vous apporte cet outil et dans quelle mesure vous souhaitez le soutenir.<br />
C'est pourquoi le modèle économique est basé sur un prix libre facturé mensuellement.<br />
</p>
</div>

<div id="free-price" class="">

+ 3
- 5
backend/views/producer/update.php Wyświetl plik

@@ -40,14 +40,12 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\helpers\Url ;

/* @var $this yii\web\View */
/* @var $model common\models\User */
$this->setTitle('Paramètres') ;
$this->addBreadcrumb($this->getTitle()) ;

$this->title = 'Paramètres';
$this->params['breadcrumbs'][] = 'Paramètres';
?>

<div class="user-update">
<h1><?= Html::encode($this->title) ?></h1>
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<div class="">

+ 4
- 10
backend/views/product/create.php Wyświetl plik

@@ -38,20 +38,14 @@ termes.

use yii\helpers\Html;

$this->setTitle('Ajouter un produit') ;
$this->addBreadcrumb(['label' => 'Produits', 'url' => ['index']]) ;
$this->addBreadcrumb('Ajouter') ;

/* @var $this yii\web\View */
/* @var $model app\models\Produit */

$this->title = 'Ajouter un produit';
$this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Ajouter';
?>
<div class="product-create">

<h1><?= Html::encode($this->title) ?></h1>

<div class="product-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>

</div>

+ 4
- 8
backend/views/product/index.php Wyświetl plik

@@ -40,16 +40,13 @@ use yii\helpers\Html;
use yii\grid\GridView;
use common\helpers\Url ;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->setTitle('Produits') ;
$this->addBreadcrumb($this->getTitle()) ;
$this->addButton(['label' => 'Ajouter', 'url' => 'product/create', 'class' => 'btn btn-primary']) ;

$this->title = 'Produits';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-index">

<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>

<div class="product-index">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
@@ -110,5 +107,4 @@ $this->params['breadcrumbs'][] = $this->title;
],
],
]); ?>

</div>

+ 6
- 10
backend/views/product/update.php Wyświetl plik

@@ -38,20 +38,16 @@ termes.

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\Produit */

$this->title = 'Modifier un produit';
$this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['update', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Modifier';
?>
<div class="product-update">
$this->setTitle('Modifier un produit') ;
$this->addBreadcrumb(['label' => 'Produits', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => $model->name, 'url' => ['update', 'id' => $model->id]]) ;
$this->addBreadcrumb('Modifier') ;

<h1><?= Html::encode($this->title) ?></h1>
?>

<div class="product-update">
<?= $this->render('_form', [
'model' => $model,
]) ?>

</div>

+ 2
- 5
backend/views/stats/index.php Wyświetl plik

@@ -36,16 +36,13 @@ pris connaissance de la licence CeCILL, et que vous en avez accepté les
termes.
*/

$this->title = 'Statistiques' ;

use dosamigos\chartjs\ChartJs;

$this->params['breadcrumbs'][] = 'Statistiques';
$this->setTitle('Statistiques <small>Chiffre d\'affaire</small>') ;
$this->addBreadcrumb($this->getTitle()) ;

?>

<h1>Statistiques</h1>

<?= ChartJs::widget([
'type' => 'line',
'options' => [

+ 4
- 9
backend/views/stats/products.php Wyświetl plik

@@ -38,19 +38,14 @@ termes.

use \backend\controllers\StatsController ;

$this->title = 'Statistiques produits' ;
$this->params['breadcrumbs'][] = 'Statistiques produits';
$this->setTitle('Statistiques <small>Produits '.$year.'</small>', 'Statistiques produits '.$year) ;
$this->addBreadcrumb('Statistiques produits '.$year) ;
$this->addButton(['label' => '&lt; '.($year - 1), 'url' => ['stats/products','year' => $year - 1], 'class' => 'btn btn-default']) ;
$this->addButton(['label' => ($year + 1).' &gt;', 'url' => ['stats/products','year' => $year + 1], 'class' => 'btn btn-default']) ;

?>
<div class="stats-products">
<h1>Statistiques produits <?= $year ?>
<div id="nav-year">
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/products','year' => $year - 1]); ?>">&lt; <?= ($year - 1) ?></a>
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/products','year' => $year + 1]); ?>"><?= ($year + 1) ?> &gt;</a>
</div>
</h1>
<?php if($empty): ?>
<div class="alert alert-warning">Aucune statistique disponible pour cette période</div>
<?php else: ?>

+ 4
- 9
backend/views/subscription/create.php Wyświetl plik

@@ -38,20 +38,15 @@ termes.

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\Produit */
$this->setTitle('Ajouter un abonnement') ;
$this->addBreadcrumb(['label' => 'Abonnements', 'url' => ['index']]) ;
$this->addBreadcrumb('Ajouter') ;

$this->title = 'Ajouter un abonnement';
$this->params['breadcrumbs'][] = ['label' => 'Abonnements', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Ajouter';
?>
<div class="subscription-create">
<h1><?= Html::encode($this->title) ?></h1>

<div class="subscription-create">
<?= $this->render('_form', [
'model' => $model,
'productsArray' => $productsArray
]) ?>

</div>

+ 5
- 7
backend/views/subscription/index.php Wyświetl plik

@@ -39,16 +39,14 @@ termes.
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Abonnements';
$this->params['breadcrumbs'][] = $this->title;
$this->setTitle('Abonnements') ;
$this->addBreadcrumb($this->getTitle()) ;
$this->addButton(['label' => 'Ajouter', 'url' => 'subscription/create', 'class' => 'btn btn-success']) ;

?>
<div class="subscription-index">

<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>

<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [

+ 4
- 8
backend/views/subscription/update.php Wyświetl plik

@@ -38,16 +38,12 @@ termes.

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\Produit */

$this->title = 'Modifier un abonnement';
$this->params['breadcrumbs'][] = ['label' => 'Abonnements', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Modifier';
$this->setTitle('Modifier un abonnement') ;
$this->addBreadcrumb(['label' => 'Abonnements', 'url' => ['index']]) ;
$this->addBreadcrumb('Modifier') ;
?>
<div class="subscription-update">
<h1><?= Html::encode($this->title) ?></h1>

<div class="subscription-update">
<?= $this->render('_form', [
'model' => $model,
'productsArray' => $productsArray

+ 4
- 7
backend/views/user/create.php Wyświetl plik

@@ -38,19 +38,16 @@ termes.

use yii\helpers\Html;

$this->setTitle('Ajouter un client') ;
$this->addBreadcrumb(['label' => 'Clients', 'url' => ['index']]) ;
$this->addBreadcrumb('Ajouter') ;

/* @var $this yii\web\View */
/* @var $model common\models\User */

$this->title = 'Ajouter un client';
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Ajouter' ;
?>

<div class="user-create">
<?php if(YII_ENV == 'demo'): ?>
<div class="alert alert-warning">Vous ne pouvez pas ajouter de client dans l'espace Démo.</div>
<?php else: ?>
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>

+ 9
- 10
backend/views/user/credit.php Wyświetl plik

@@ -41,10 +41,10 @@ use yii\widgets\ActiveForm;
use common\models\CreditHistory;
use common\models\Producer;

$this->title = 'Créditer <small>'.Html::encode($user->lastname.' '.$user->name).'</small>';
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => Html::encode($user->lastname.' '.$user->name)];
$this->params['breadcrumbs'][] = 'Créditer';
$this->setTitle('Créditer <small>'.Html::encode($user->lastname.' '.$user->name).'</small>', 'Créditer '.Html::encode($user->lastname.' '.$user->name)) ;
$this->addBreadcrumb(['label' => 'Clients', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => Html::encode($user->lastname.' '.$user->name)]) ;
$this->addBreadcrumb('Créditer') ;

?>

@@ -63,7 +63,6 @@ $this->params['breadcrumbs'][] = 'Créditer';
?>
<div class="col-md-12">
<h1><?= $this->title ?></h1>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($creditForm, 'type')->dropDownList([
CreditHistory::TYPE_CREDIT => 'Crédit',
@@ -71,13 +70,13 @@ $this->params['breadcrumbs'][] = 'Créditer';
]) ?>
<?= $form->field($creditForm, 'amount')->textInput() ?>
<?= $form->field($creditForm, 'mean_payment')->dropDownList([
CreditHistory::MEAN_PAYMENT_MONEYS => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_MONEYS),
CreditHistory::MOYEN_CB => CreditHistory::getStrMeanPaymentBy(CreditHistory::MOYEN_CB),
CreditHistory::MOYEN_CHEQUE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MOYEN_CHEQUE),
CreditHistory::MOYEN_AUTRE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MOYEN_AUTRE),
CreditHistory::MEAN_PAYMENT_MONEY => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_MONEY),
CreditHistory::MEAN_PAYMENT_CREDIT_CARD => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CREDIT_CARD),
CreditHistory::MEAN_PAYMENT_CHEQUE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CHEQUE),
CreditHistory::MEAN_PAYMENT_OTHER => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_OTHER),
]) ?>
<?= $form->field($creditForm, 'comment')->textarea() ?>
<?= $form->field($creditForm, 'sendMail')->checkbox() ?>
<?= $form->field($creditForm, 'send_mail')->checkbox() ?>
<div class="form-group">
<?= Html::submitButton( 'Créditer', ['class' => 'btn btn-primary']) ?>

+ 4
- 6
backend/views/user/emails.php Wyświetl plik

@@ -38,15 +38,13 @@ termes.

use yii\helpers\Html ;

$this->title = 'Liste des emails';
$this->params['breadcrumbs'][] = ['label' => 'Utilisateurs',
'url' => ['user/index']] ;
$this->params['breadcrumbs'][] = $this->title;
$this->setTitle('Liste des emails') ;
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['user/index']]) ;
$this->addBreadcrumb($this->getTitle()) ;

?>

<h1><?php if(isset($pointSale) && $pointSale): echo Html::encode($pointSale->name).' : '; endif; ?><?= count($usersArray); ?> utilisateurs</h1>

<h3><?= count($usersArray); ?> utilisateurs</h3>
<ul id="tabs-points-sale" class="nav nav-tabs" role="tablist">
<li class="<?php if(!isset($pointSale)): ?>active<?php endif; ?>">
<a href="<?= Yii::$app->urlManager->createUrl(['user/mail']); ?>">Tous</a>

+ 3
- 10
backend/views/user/index.php Wyświetl plik

@@ -41,20 +41,13 @@ use yii\grid\GridView;
use common\models\User ;
use common\models\Order ;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->setTitle('Utilisateurs') ;
$this->addBreadcrumb($this->getTitle()) ;
$this->addButton(['label' => 'Ajouter', 'url' => 'user/create', 'class' => 'btn btn-primary']) ;

$this->title = 'Utilisateurs';
$this->params['breadcrumbs'][] = $this->title;
?>


<div class="user-index">
<h1>
<?= Html::encode($this->title) ?>
<?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-primary']) ?>
</h1>
<ul id="tabs-points-vente" class="nav nav-tabs" role="tablist">
<li class="<?php if(!$idPointSaleActive && !$sectionInactiveUsers): ?>active<?php endif; ?>">
<a href="<?= Yii::$app->urlManager->createUrl(['user/index']); ?>">Tous</a>

+ 13
- 16
backend/views/user/orders.php Wyświetl plik

@@ -42,36 +42,33 @@ use common\models\CreditHistory;
use common\models\Producer;
use common\models\Order;

$this->title = 'Commandes <small>'.Html::encode($user->lastname.' '.$user->name).'</small>';
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => Html::encode($user->lastname.' '.$user->name)];
$this->params['breadcrumbs'][] = 'Créditer';
$this->setTitle('Commandes <small>'.Html::encode($user->lastname.' '.$user->name).'</small>', 'Commandes de '.Html::encode($user->lastname.' '.$user->name)) ;
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => Html::encode($user->lastname.' '.$user->name)]) ;
$this->addBreadcrumb('Commandes') ;

?>

<div class="user-orders">
<h1><?= $this->title ?> </h1>
<?php if(count($commandes)): ?>
<?php if(count($ordersArray)): ?>
<table id="historique-commandes" class="table table-striped table-bordered">
<thead>
<tr>
<th>Historique</th>
<th>Date livraison</th>
<th>Historique</th>
<th>Résumé</th>
<th>Point de vente</th>
<th class="montant">Montant</th>
</tr>
</thead>
<tbody>
<?php foreach($commandes as $c): ?>
<tr class="<?= $c->getClassHistorique() ; ?>">
<td class="historique"><?= $c->getStrHistorique() ; ?></td>
<td><?php echo date('d/m/Y',strtotime($c->production->date)); ?></td>
<td class="resume"><?= $c->getResumePanier() ; ?></td>
<td><?= $c->getResumePointVente(); ?></td>
<td class="montant"><?= $c->getResumeMontant(); ?></td>
<?php foreach($ordersArray as $order): ?>
<tr class="<?= $order->getClassHistory() ; ?>">
<td><?php echo date('d/m/Y',strtotime($order->distribution->date)); ?></td>
<td class="historique"><?= $order->getStrHistory() ; ?></td>
<td class="resume"><?= $order->getCartSummary() ; ?></td>
<td><?= $order->getPointSaleSummary(); ?></td>
<td class="montant"><?= $order->getAmountSummary(); ?></td>
</tr>
<?php endforeach; ?>
</tbody>

+ 5
- 10
backend/views/user/update.php Wyświetl plik

@@ -38,20 +38,15 @@ termes.

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model common\models\User */
$this->setTitle('Modifier un client') ;
$this->addBreadcrumb(['label' => 'Clients', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => Html::encode($model->lastname.' '.$model->name)]) ;
$this->addBreadcrumb('Modifier') ;

$this->title = 'Modifier un client' ;
$this->params['breadcrumbs'][] = ['label' => 'Clients', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => Html::encode($model->lastname.' '.$model->name)];
$this->params['breadcrumbs'][] = 'Modifier';
?>
<div class="user-update">

<h1><?= Html::encode($this->title) ?></h1>

<div class="user-update">
<?= $this->render('_form', [
'model' => $model,
]) ?>

</div>

+ 23
- 12
backend/web/css/screen.css Wyświetl plik

@@ -1450,58 +1450,69 @@ body.skin-black .content-wrapper {
background-color: #f5f5f5;
}
/* line 62, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header {
background-color: #eeeeee;
padding-bottom: 15px;
border-bottom: solid 1px #e0e0e0;
}
/* line 68, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header .btn {
padding: 3px 6px;
font-size: 13px;
}
/* line 74, ../sass/_adminlte.scss */
body.skin-black .content-wrapper a {
color: #BB8757;
}
/* line 66, ../sass/_adminlte.scss */
/* line 78, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn {
color: white;
}
/* line 70, ../sass/_adminlte.scss */
/* line 82, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-default {
color: #333;
}
/* line 74, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-primary {
/* line 86, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-primary, body.skin-black .content-wrapper .btn-success {
background-color: #BB8757;
color: white;
border-color: #BB8757;
}
/* line 82, ../sass/_adminlte.scss */
/* line 94, ../sass/_adminlte.scss */
body.skin-black .main-footer a {
color: #BB8757;
}

/* line 88, ../sass/_adminlte.scss */
/* line 100, ../sass/_adminlte.scss */
body.login-page {
background: none;
background-color: #F8F1DD;
}
/* line 92, ../sass/_adminlte.scss */
/* line 104, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo {
text-align: center;
font-family: "comfortaalight";
}
/* line 95, ../sass/_adminlte.scss */
/* line 107, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo img {
width: 50px;
}
/* line 100, ../sass/_adminlte.scss */
/* line 112, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary {
background-color: #BB8757;
border-color: #BB8757;
padding: 5px 10px;
}
/* line 105, ../sass/_adminlte.scss */
/* line 117, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary:active {
background-color: #c29469;
border-color: #BB8757;
}
/* line 111, ../sass/_adminlte.scss */
/* line 123, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a {
color: #BB8757;
}
/* line 113, ../sass/_adminlte.scss */
/* line 125, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a:hover {
color: #c29469;
}

+ 13
- 1
backend/web/sass/_adminlte.scss Wyświetl plik

@@ -59,6 +59,18 @@ body.skin-black {
.content-wrapper {
background-color: #f5f5f5 ;
.content-header {
//background-color: $color2 ;
background-color: #eeeeee ;
padding-bottom: 15px ;
border-bottom: solid 1px #e0e0e0 ;
.btn {
padding: 3px 6px ;
font-size: 13px ;
}
}
a {
color: $color1 ;
}
@@ -71,7 +83,7 @@ body.skin-black {
color: #333 ;
}
.btn-primary {
.btn-primary, .btn-success {
background-color: $color1 ;
color: white ;
border-color: $color1 ;

+ 15
- 3
common/components/MyView.php Wyświetl plik

@@ -40,17 +40,19 @@ namespace common\components ;

class MyView extends \yii\web\View
{
var $title ;
var $page_title ;
var $buttons ;
public function setTitle($title, $page_title = '')
{
$this->title = $title ;
if(strlen($page_title))
if(strlen($page_title)) {
$this->page_title = $page_title ;
else
}
else {
$this->page_title = $title ;
}
}
public function getTitle()
@@ -73,4 +75,14 @@ class MyView extends \yii\web\View
return Yii::$app->controller->id.'/'.Yii::$app->controller->action->id ;
}
public function addBreadcrumb($breadcrumb)
{
$this->params['breadcrumbs'][] = $breadcrumb ;
}
public function addButton($button)
{
$this->buttons[] = $button ;
}
}

+ 2
- 2
common/models/CreditHistory.php Wyświetl plik

@@ -55,7 +55,7 @@ use yii\helpers\Html;
* @property double $amount
* @property string $type
* @property integer $id_producer
* @property string $mean_payement
* @property string $mean_payment
*/
class CreditHistory extends ActiveRecordCommon
{
@@ -325,7 +325,7 @@ class CreditHistory extends ActiveRecordCommon
*/
public function getStrMeanPayment()
{
self::getStrMeanPaymentBy($this->mean_payement) ;
self::getStrMeanPaymentBy($this->mean_payment) ;
}
/**

+ 1
- 1
common/models/Order.php Wyświetl plik

@@ -394,7 +394,7 @@ class Order extends ActiveRecordCommon
$html .= '<span class="label label-success">Payée</span>';
} elseif ($this->getPaymentStatus() == Order::PAYMENT_UNPAID) {
$html .= '<span class="label label-danger">Non payée</span><br />
Reste <strong>' . $this->getRemainingAmount(true) . '</strong> à payer';
Reste <strong>' . $this->getAmount(Order::AMOUNT_REMAINING, true) . '</strong> à payer';
} elseif ($this->getPaymentStatus() == Order::PAYMENT_SURPLUS) {
$html .= '<span class="label label-success">Payée</span>';
}

+ 2
- 0
common/models/User.php Wyświetl plik

@@ -113,6 +113,8 @@ class User extends ActiveRecordCommon implements IdentityInterface
{
return [
'id' => 'ID',
'name' => 'Prénom',
'lastname' => 'Nom',
'username' => 'Identifiant',
'password' => 'Mot de passe',
'rememberMe' => 'Se souvenir de moi',

Ładowanie…
Anuluj
Zapisz