瀏覽代碼

Activer/désactiver une boulangerie

Le boulanger a la possibilité d'activer ou de désactiver sa boulangerie dans ses paramètres. L'accès au formulaire de commande est restreint suivant ce paramètre.

Cette option permet au boulanger de gérer les périodes où il ne travaille pas ainsi que la période de lancement du système de réservation.
master
keun 8 年之前
父節點
當前提交
03e025b10d
共有 10 個文件被更改,包括 252 次插入160 次删除
  1. +9
    -1
      backend/views/etablissement/update.php
  2. +11
    -1
      backend/views/layouts/main.php
  3. 二進制
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  4. +151
    -132
      backend/web/css/screen.css
  5. +18
    -0
      backend/web/sass/screen.scss
  6. +4
    -2
      common/models/Etablissement.php
  7. +2
    -16
      common/models/User.php
  8. +17
    -0
      console/migrations/m161214_153820_add_champs_etablissement_actif.php
  9. +22
    -3
      frontend/controllers/CommandeController.php
  10. +18
    -5
      frontend/views/commande/_liste_etablissements.php

+ 9
- 1
backend/views/etablissement/update.php 查看文件

@@ -14,12 +14,20 @@ $this->params['breadcrumbs'][] = 'Paramètres';
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<div class="">
<?= $form->field($model, 'actif')
->dropDownList([
0 => 'Non',
1 => 'Oui'
], [])
->label('Activer la boulangerie')
->hint('Activez cette option pour rendre votre boulangerie visible à vos clients.') ; ?>
<?= $form->field($model, 'code_postal') ?>
<?= $form->field($model, 'ville') ?>
<?= $form->field($model, 'code')->hint("Saisissez ce champs si vous souhaitez protéger l'accès à votre boutique par un code, sinon laissez-le vide.<br />"
. "Ce code est à communiquer à vos client pour qu'ils puissent ajouter votre boulangerie à leur tableau de bord.<br />"
. "<a href=\"".Yii::$app->urlManager->createUrl(['communiquer/index'])."\">Cliquez ici</a> pour télécharger un mode d'emploi comprenant ce code à distribuer à vos clients.") ?>
<?= $form->field($model, 'delai_commande')
->dropDownList([
1 => '1 jour',

+ 11
- 1
backend/views/layouts/main.php 查看文件

@@ -95,12 +95,22 @@ AppAsset::register($this);
<?php if(Yii::$app->user->identity->status == User::STATUS_BOULANGER): ?>
<span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
<?php elseif(Yii::$app->user->identity->status == User::STATUS_ADMIN): ?>
<?php $form = ActiveForm::begin() ; ?>
<?php $form = ActiveForm::begin(['id' => 'select-etablissement']) ; ?>
<?= Html::dropDownList('select_etablissement', Yii::$app->user->identity->id_etablissement, ArrayHelper::map(Etablissement::find()->orderBy('nom ASC')->all(), 'id', function($model, $defaultValue) {
return Html::encode($model->nom) ;
})) ; ?>
<?php ActiveForm::end(); ?>
<?php endif; ?>
<?php
$etablissement = Etablissement::findOne(Yii::$app->user->identity->id_etablissement) ;
if(!$etablissement->actif):
?>
<span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Activez votre boulangerie quand vous le souhaitez afin de la rendre visible à vos clients.">
<?= Html::a('Hors-ligne',['etablissement/update']); ?>
</span>
<?php endif; ?>
<div class="clr"></div>
<?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?>
<?php if($etat_paiement_etablissement == 'essai'): ?>

二進制
backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc 查看文件


+ 151
- 132
backend/web/css/screen.css 查看文件

@@ -229,162 +229,181 @@ a:hover, a:focus, a:active {
.nom-boulange #etat-paiement-etablissement .btn {
padding: 2px 5px;
}
/* line 181, ../sass/screen.scss */
.nom-boulange #select-etablissement {
float: left;
}
/* line 185, ../sass/screen.scss */
.nom-boulange .label {
font-size: 11px;
margin-left: 10px;
position: relative;
bottom: 3px;
}
/* line 190, ../sass/screen.scss */
.nom-boulange .label a {
color: white;
}
/* line 192, ../sass/screen.scss */
.nom-boulange .label a:hover {
text-decoration: none;
}

/* line 184, ../sass/screen.scss */
/* line 202, ../sass/screen.scss */
.table thead th.actions {
width: 220px;
}
/* line 187, ../sass/screen.scss */
/* line 205, ../sass/screen.scss */
.table thead th.order {
width: 58px;
}
/* line 190, ../sass/screen.scss */
/* line 208, ../sass/screen.scss */
.table thead th.actif {
width: 75px;
text-align: center;
}
/* line 196, ../sass/screen.scss */
/* line 214, ../sass/screen.scss */
.table tbody td.center {
text-align: center;
}

/* line 209, ../sass/screen.scss */
/* line 227, ../sass/screen.scss */
#page-commande h1 .btn-group {
float: right;
}
/* line 214, ../sass/screen.scss */
/* line 232, ../sass/screen.scss */
#page-commande #col-left, #page-commande #col-right {
padding-left: 0px;
padding-right: 0px;
}
/* line 218, ../sass/screen.scss */
/* line 236, ../sass/screen.scss */
#page-commande #col-right {
padding-left: 20px;
}
/* line 222, ../sass/screen.scss */
/* line 240, ../sass/screen.scss */
#page-commande #jours-production {
display: none;
}
/* line 228, ../sass/screen.scss */
/* line 246, ../sass/screen.scss */
#page-commande #calendar h2 {
font-size: 20px;
position: relative;
top: 3px;
}
/* line 234, ../sass/screen.scss */
/* line 252, ../sass/screen.scss */
#page-commande #calendar .fc-header-title {
margin-left: 10px;
}
/* line 240, ../sass/screen.scss */
/* line 258, ../sass/screen.scss */
#page-commande #calendar .dayWithEvent {
background-color: #fee48d;
cursor: pointer;
}
/* line 244, ../sass/screen.scss */
/* line 262, ../sass/screen.scss */
#page-commande #calendar .fc-event-container {
display: none;
}
/* line 245, ../sass/screen.scss */
/* line 263, ../sass/screen.scss */
#page-commande #calendar .fc-today {
border-bottom: solid 1px #C9302C;
background-color: white;
}
/* line 249, ../sass/screen.scss */
/* line 267, ../sass/screen.scss */
#page-commande #calendar .fc-today.dayWithEvent {
background-color: #fee48d;
}
/* line 254, ../sass/screen.scss */
/* line 272, ../sass/screen.scss */
#page-commande #calendar .fc-day {
cursor: pointer;
text-align: center;
}
/* line 257, ../sass/screen.scss */
/* line 275, ../sass/screen.scss */
#page-commande #calendar .fc-day:hover {
-moz-box-shadow: 0px 0px 2px black inset;
-webkit-box-shadow: 0px 0px 2px black inset;
box-shadow: 0px 0px 2px black inset;
}
/* line 262, ../sass/screen.scss */
/* line 280, ../sass/screen.scss */
#page-commande #calendar .current-date {
-moz-box-shadow: 0px 0px 2px black inset;
-webkit-box-shadow: 0px 0px 2px black inset;
box-shadow: 0px 0px 2px black inset;
}
/* line 266, ../sass/screen.scss */
/* line 284, ../sass/screen.scss */
#page-commande #calendar .fc-day-number {
float: none;
padding-top: 2px;
}
/* line 274, ../sass/screen.scss */
/* line 292, ../sass/screen.scss */
#page-commande #bloc-production .label {
float: right;
font-size: 13px;
}
/* line 279, ../sass/screen.scss */
/* line 297, ../sass/screen.scss */
#page-commande #bloc-production .btn-success {
background-color: #5cb85c;
border-color: #4cae4c;
}
/* line 292, ../sass/screen.scss */
/* line 310, ../sass/screen.scss */
#page-commande #produits-production .overflow table {
width: 100%;
}
/* line 296, ../sass/screen.scss */
/* line 314, ../sass/screen.scss */
#page-commande #produits-production .overflow thead, #page-commande #produits-production .overflow tbody, #page-commande #produits-production .overflow tr, #page-commande #produits-production .overflow td, #page-commande #produits-production .overflow th {
display: block;
}
/* line 298, ../sass/screen.scss */
/* line 316, ../sass/screen.scss */
#page-commande #produits-production .overflow tr:after {
content: ' ';
display: block;
visibility: hidden;
clear: both;
}
/* line 305, ../sass/screen.scss */
/* line 323, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
height: 30px;
/*text-align: left;*/
}
/* line 311, ../sass/screen.scss */
/* line 329, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody {
height: 500px;
overflow-y: auto;
}
/* line 319, ../sass/screen.scss */
/* line 337, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
width: 32%;
float: left;
}
/* line 324, ../sass/screen.scss */
/* line 342, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody td {
width: 33%;
float: left;
}
/* line 329, ../sass/screen.scss */
/* line 347, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-produit {
width: 60%;
}
/* line 332, ../sass/screen.scss */
/* line 350, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-actif, #page-commande #produits-production .overflow .td-max {
width: 20%;
text-align: center;
}
/* line 338, ../sass/screen.scss */
/* line 356, ../sass/screen.scss */
#page-commande #produits-production .overflow thead .td-produit {
width: 57%;
}
/* line 344, ../sass/screen.scss */
/* line 362, ../sass/screen.scss */
#page-commande #produits-production input.quantite-max {
background-color: white;
border: 1px solid #e0e0e0;
text-align: center;
width: 50px;
}
/* line 352, ../sass/screen.scss */
/* line 370, ../sass/screen.scss */
#page-commande #produits-production td label {
font-weight: normal;
}
/* line 358, ../sass/screen.scss */
/* line 376, ../sass/screen.scss */
#page-commande #btn-export-commandes,
#page-commande #btn-commande-auto {
float: right;
@@ -393,30 +412,30 @@ a:hover, a:focus, a:active {
right: -7px;
padding: 2px 5px;
}
/* line 367, ../sass/screen.scss */
/* line 385, ../sass/screen.scss */
#page-commande #btn-export-commandes {
color: white;
margin-left: 10px;
padding: 1px 5px;
}
/* line 375, ../sass/screen.scss */
/* line 393, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .depasse {
color: #b32815;
}
/* line 379, ../sass/screen.scss */
/* line 397, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 388, ../sass/screen.scss */
/* line 406, ../sass/screen.scss */
#page-commande #commandes-points-vente .tab-pane {
padding-top: 20px;
}
/* line 395, ../sass/screen.scss */
/* line 413, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv.no-commande .recettes {
display: none;
}
/* line 399, ../sass/screen.scss */
/* line 417, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv .recettes {
float: right;
color: #BB8757;
@@ -429,11 +448,11 @@ a:hover, a:focus, a:active {
position: relative;
top: -3px;
}
/* line 413, ../sass/screen.scss */
/* line 431, ../sass/screen.scss */
#page-commande #commandes-points-vente .alert.commentaire {
display: none;
}
/* line 417, ../sass/screen.scss */
/* line 435, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes {
margin-top: 10px;
list-style-type: none;
@@ -445,12 +464,12 @@ a:hover, a:focus, a:active {
width: 100%;
overflow-y: scroll;
}
/* line 429, ../sass/screen.scss */
/* line 447, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li {
padding: 0;
margin: 0;
}
/* line 432, ../sass/screen.scss */
/* line 450, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a {
text-align: left;
-moz-border-radius: 0px;
@@ -460,22 +479,22 @@ a:hover, a:focus, a:active {
padding: 7px;
color: #333;
}
/* line 440, ../sass/screen.scss */
/* line 458, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant {
float: right;
color: #BB8757;
font-weight: bold;
}
/* line 445, ../sass/screen.scss */
/* line 463, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant.paye {
color: #5cb85c;
color: #519951;
}
/* line 451, ../sass/screen.scss */
/* line 469, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment {
color: #BB8757;
}
/* line 455, ../sass/screen.scss */
/* line 473, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a:hover, #page-commande #commandes-points-vente ul.liste-commandes li a:active, #page-commande #commandes-points-vente ul.liste-commandes li a.active {
text-decoration: none;
background-color: #FCF8E3;
@@ -486,81 +505,81 @@ a:hover, a:focus, a:active {
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
/* line 469, ../sass/screen.scss */
/* line 487, ../sass/screen.scss */
#page-commande #commandes-points-vente .creer-commande,
#page-commande #commandes-points-vente .commandes-auto {
width: 100%;
margin-bottom: 10px;
}
/* line 475, ../sass/screen.scss */
/* line 493, ../sass/screen.scss */
#page-commande #commandes-points-vente .bloc-commande {
padding-top: 20px;
margin-top: 20px;
display: none;
}
/* line 481, ../sass/screen.scss */
/* line 499, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user {
display: none;
font-size: 19px;
margin-top: 0px;
}
/* line 486, ../sass/screen.scss */
/* line 504, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .btn-edit, #page-commande #commandes-points-vente .title-user .btn-remove,
#page-commande #commandes-points-vente .title-user .btn-cancel, #page-commande #commandes-points-vente .title-user .btn-save {
float: right;
position: relative;
top: -6px;
}
/* line 493, ../sass/screen.scss */
/* line 511, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .btn-edit, #page-commande #commandes-points-vente .title-user .btn-cancel {
margin-right: 10px;
}
/* line 497, ../sass/screen.scss */
/* line 515, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .buttons-save-cancel {
display: none;
}
/* line 501, ../sass/screen.scss */
/* line 519, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user {
display: none;
}
/* line 504, ../sass/screen.scss */
/* line 522, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user .form-control {
width: 200px;
display: inline;
}
/* line 512, ../sass/screen.scss */
/* line 530, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits .td-commande {
text-align: center;
}
/* line 515, ../sass/screen.scss */
/* line 533, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits input.form-control {
text-align: center;
}
/* line 521, ../sass/screen.scss */
/* line 539, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit,
#page-commande #commandes-points-vente .th-produit {
width: 70%;
}
/* line 526, ../sass/screen.scss */
/* line 544, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande,
#page-commande #commandes-points-vente .th-commande {
width: 30%;
text-align: center;
}
/* line 532, ../sass/screen.scss */
/* line 550, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit {
text-transform: uppercase;
}
/* line 536, ../sass/screen.scss */
/* line 554, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande {
font-weight: bold;
}
/* line 540, ../sass/screen.scss */
/* line 558, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total {
font-size: 18px;
text-align: center;
}
/* line 544, ../sass/screen.scss */
/* line 562, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total span {
padding: 2px 10px;
background-color: #BB8757;
@@ -570,33 +589,33 @@ a:hover, a:focus, a:active {
-webkit-border-radius: 8px;
border-radius: 8px;
}
/* line 554, ../sass/screen.scss */
/* line 572, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-paiement .buttons-credit {
float: right;
}
/* line 560, ../sass/screen.scss */
/* line 578, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .field-commandeautoform-id_user,
#page-commande #commandes-points-vente .panel-commande-automatique .field-commandeautoform-id_etablissement {
display: none;
}
/* line 567, ../sass/screen.scss */
/* line 585, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .jours .form-group {
float: left;
margin-right: 10px;
}
/* line 576, ../sass/screen.scss */
/* line 594, ../sass/screen.scss */
#page-commande #old-commandes {
display: none;
}
/* line 580, ../sass/screen.scss */
/* line 598, ../sass/screen.scss */
#page-commande .form-commandes-point-vente {
margin-top: 20px;
}
/* line 584, ../sass/screen.scss */
/* line 602, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0;
}
/* line 588, ../sass/screen.scss */
/* line 606, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2;
border-left: solid 3px #BB8757;
@@ -604,76 +623,76 @@ a:hover, a:focus, a:active {
text-align: left;
padding: 10px;
}
/* line 596, ../sass/screen.scss */
/* line 614, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux {
text-align: center;
}
/* line 600, ../sass/screen.scss */
/* line 618, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0;
}
/* line 604, ../sass/screen.scss */
/* line 622, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0;
}
/* line 608, ../sass/screen.scss */
/* line 626, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite {
width: 30px;
background-color: white;
border: solid 1px #e0e0e0;
text-align: center;
}
/* line 616, ../sass/screen.scss */
/* line 634, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit {
text-align: center;
}
/* line 620, ../sass/screen.scss */
/* line 638, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv {
float: right;
}
/* line 624, ../sass/screen.scss */
/* line 642, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9;
border: solid 1px #e0e0e0;
}
/* line 629, ../sass/screen.scss */
/* line 647, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande {
font-size: 12px;
}
/* line 633, ../sass/screen.scss */
/* line 651, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .datepicker, #page-commande .form-commandes-point-vente .text {
background-color: white;
border: solid 1px #e0e0e0;
margin-top: 3px;
width: 100px;
}
/* line 641, ../sass/screen.scss */
/* line 659, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center {
text-align: center;
}
/* line 647, ../sass/screen.scss */
/* line 665, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse {
color: #b32815;
}
/* line 651, ../sass/screen.scss */
/* line 669, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 656, ../sass/screen.scss */
/* line 674, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac {
display: none;
}
/* line 660, ../sass/screen.scss */
/* line 678, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client {
text-align: left;
padding: 3px;
}
/* line 663, ../sass/screen.scss */
/* line 681, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande {
color: gray;
}
/* line 670, ../sass/screen.scss */
/* line 688, ../sass/screen.scss */
#page-commande .table-header-rotated {
border-top: 0px;
border-left: 0px;
@@ -681,15 +700,15 @@ a:hover, a:focus, a:active {
width: 100%;
width: auto;
}
/* line 677, ../sass/screen.scss */
/* line 695, ../sass/screen.scss */
#page-commande .table-header-rotated .total strong {
border-bottom: solid 1px gray;
}
/* line 682, ../sass/screen.scss */
/* line 700, ../sass/screen.scss */
#page-commande .table-header-rotated th.row-header {
width: auto;
}
/* line 686, ../sass/screen.scss */
/* line 704, ../sass/screen.scss */
#page-commande .table-header-rotated td {
width: 40px;
border-top: 1px solid #dddddd;
@@ -698,7 +717,7 @@ a:hover, a:focus, a:active {
vertical-align: middle;
text-align: center;
}
/* line 695, ../sass/screen.scss */
/* line 713, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 {
font-weight: normal;
height: 80px;
@@ -712,7 +731,7 @@ a:hover, a:focus, a:active {
line-height: 1;
border: 0px none;
}
/* line 709, ../sass/screen.scss */
/* line 727, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div {
background-color: #F5F5F5;
position: relative;
@@ -730,7 +749,7 @@ a:hover, a:focus, a:active {
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
/* line 726, ../sass/screen.scss */
/* line 744, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 span {
-ms-transform: skew(45deg, 0deg) rotate(315deg);
-moz-transform: skew(45deg, 0deg) rotate(315deg);
@@ -748,51 +767,51 @@ a:hover, a:focus, a:active {
text-align: left;
}

/* line 747, ../sass/screen.scss */
/* line 765, ../sass/screen.scss */
#email-masse-form #ids-users {
line-height: 30px;
}
/* line 749, ../sass/screen.scss */
/* line 767, ../sass/screen.scss */
#email-masse-form #ids-users .label {
text-transform: capitalize;
}

/* line 757, ../sass/screen.scss */
/* line 775, ../sass/screen.scss */
.produit-create #jours-production .form-group, .produit-update #jours-production .form-group {
float: left;
margin-right: 15px;
}
/* line 761, ../sass/screen.scss */
/* line 779, ../sass/screen.scss */
.produit-create #jours-production .form-group label, .produit-update #jours-production .form-group label {
font-weight: normal;
}
/* line 766, ../sass/screen.scss */
/* line 784, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement, .produit-update .field-produit-id_etablissement {
display: none;
}

/* line 771, ../sass/screen.scss */
/* line 789, ../sass/screen.scss */
.table-striped > tbody > tr:nth-of-type(2n) {
background-color: white;
}

/* line 776, ../sass/screen.scss */
/* line 794, ../sass/screen.scss */
.wrap .produit-index .td-photo {
max-width: 100px;
width: 100px;
}
/* line 780, ../sass/screen.scss */
/* line 798, ../sass/screen.scss */
.wrap .produit-index .photo-produit {
max-width: 100px;
}
/* line 784, ../sass/screen.scss */
/* line 802, ../sass/screen.scss */
.wrap .produit-index .ui-state-highlight {
height: 75px;
background-color: #F8F1DD;
}

/* communiquer */
/* line 792, ../sass/screen.scss */
/* line 810, ../sass/screen.scss */
.communiquer-mode-emploi {
border: solid 1px #e0e0e0;
padding: 10px;
@@ -802,18 +821,18 @@ a:hover, a:focus, a:active {
margin-bottom: 30px;
font-family: "myriadpro-regular";
}
/* line 800, ../sass/screen.scss */
/* line 818, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo {
float: left;
width: 75px;
padding-right: 20px;
padding-top: 10px;
}
/* line 806, ../sass/screen.scss */
/* line 824, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo img {
width: 75px;
}
/* line 812, ../sass/screen.scss */
/* line 830, ../sass/screen.scss */
.communiquer-mode-emploi .header h1 {
font-family: "comfortaaregular";
font-size: 40px;
@@ -821,7 +840,7 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
font-weight: normal;
}
/* line 820, ../sass/screen.scss */
/* line 838, ../sass/screen.scss */
.communiquer-mode-emploi .header h2 {
margin-top: 0px;
font-family: "myriadpro-regular";
@@ -831,7 +850,7 @@ a:hover, a:focus, a:active {
left: 2px;
font-weight: normal;
}
/* line 831, ../sass/screen.scss */
/* line 849, ../sass/screen.scss */
.communiquer-mode-emploi h3 {
font-family: "comfortaalight";
font-family: "myriadpro-regular";
@@ -841,45 +860,45 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
}

/* line 841, ../sass/screen.scss */
/* line 859, ../sass/screen.scss */
.communiquer-mode-emploi-encart {
width: 420px;
margin-top: 20px;
}
/* line 845, ../sass/screen.scss */
/* line 863, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo {
width: 60px;
margin-right: 20px;
padding-top: 5px;
}
/* line 850, ../sass/screen.scss */
/* line 868, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo img {
width: 60px;
}
/* line 856, ../sass/screen.scss */
/* line 874, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header h1 {
margin-bottom: 3px;
}
/* line 865, ../sass/screen.scss */
/* line 883, ../sass/screen.scss */
.communiquer-mode-emploi-encart h3 {
margin-top: 15px;
margin-bottom: 15px;
}

/* line 871, ../sass/screen.scss */
/* line 889, ../sass/screen.scss */
.bloc-mode-emploi-pdf {
width: 49.9%;
float: left;
border-bottom: dotted 1px gray;
}

/* line 877, ../sass/screen.scss */
/* line 895, ../sass/screen.scss */
.bloc-mode-emploi-border {
border-right: dotted 1px gray;
border-bottom: dotted 1px gray;
}

/* line 882, ../sass/screen.scss */
/* line 900, ../sass/screen.scss */
.communiquer-mode-emploi-pdf {
border: 0px none;
-moz-border-radius: 0px;
@@ -888,88 +907,88 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
padding: 20px 0px 20px 30px;
}
/* line 890, ../sass/screen.scss */
/* line 908, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo {
float: left;
width: 55px;
padding-right: 15px;
padding-top: 10px;
}
/* line 896, ../sass/screen.scss */
/* line 914, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo img {
width: 55px;
}
/* line 900, ../sass/screen.scss */
/* line 918, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h1 {
font-size: 32px;
}
/* line 903, ../sass/screen.scss */
/* line 921, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h2 {
font-size: 16px;
}
/* line 908, ../sass/screen.scss */
/* line 926, ../sass/screen.scss */
.communiquer-mode-emploi-pdf h3 {
font-weight: normal;
}

/* line 913, ../sass/screen.scss */
/* line 931, ../sass/screen.scss */
.bloc-mode-emploi-bottom {
border-bottom: 0px none;
border-bottom: solid 1px white;
}

/* commandes auto */
/* line 923, ../sass/screen.scss */
/* line 941, ../sass/screen.scss */
.commandeauto-form #bloc-select-user {
padding-left: 0px;
}
/* line 927, ../sass/screen.scss */
/* line 945, ../sass/screen.scss */
.commandeauto-form #or-user {
font-size: 20px;
text-align: center;
}
/* line 930, ../sass/screen.scss */
/* line 948, ../sass/screen.scss */
.commandeauto-form #or-user span {
position: relative;
top: 24px;
}
/* line 936, ../sass/screen.scss */
/* line 954, ../sass/screen.scss */
.commandeauto-form .field-commandeautoform-id_etablissement {
display: none;
}
/* line 940, ../sass/screen.scss */
/* line 958, ../sass/screen.scss */
.commandeauto-form .jours .form-group {
float: left;
margin-right: 20px;
}
/* line 947, ../sass/screen.scss */
/* line 965, ../sass/screen.scss */
.commandeauto-form .produits .table {
width: 500px;
}
/* line 950, ../sass/screen.scss */
/* line 968, ../sass/screen.scss */
.commandeauto-form .produits .quantite {
text-align: center;
}

/* points de vente */
/* line 959, ../sass/screen.scss */
/* line 977, ../sass/screen.scss */
.point-vente-form #pointvente-users {
display: none;
height: 500px;
overflow-y: scroll;
}
/* line 963, ../sass/screen.scss */
/* line 981, ../sass/screen.scss */
.point-vente-form #pointvente-users label {
font-weight: normal;
display: block;
}

/* utilisateurs */
/* line 973, ../sass/screen.scss */
/* line 991, ../sass/screen.scss */
.user-index .input-group {
width: 180px;
}
/* line 976, ../sass/screen.scss */
/* line 994, ../sass/screen.scss */
.user-index .input-group .input-credit {
text-align: center;
}

+ 18
- 0
backend/web/sass/screen.scss 查看文件

@@ -177,8 +177,26 @@ a {
padding: 2px 5px ;
}
}
#select-etablissement {
float: left ;
}

.label {
font-size: 11px ;
margin-left: 10px ;
position: relative ;
bottom: 3px ;
a {
color: white ;
&:hover {
text-decoration: none ;
}
}
}
}


.table {
thead {
th.actions {

+ 4
- 2
common/models/Etablissement.php 查看文件

@@ -55,7 +55,7 @@ class Etablissement extends \yii\db\ActiveRecord
}
}],
[['description'], 'string'],
[['solde_negatif', 'credit_pain'], 'boolean'],
[['solde_negatif', 'credit_pain','actif'], 'boolean'],
[['nom', 'siret', 'logo', 'photo', 'code_postal', 'ville','code'], 'string', 'max' => 255],
];
}
@@ -78,7 +78,8 @@ class Etablissement extends \yii\db\ActiveRecord
'heure_limite_commande' => 'Heure limite de commande',
'delai_commande' => 'Délai de commande',
'solde_negatif' => 'Solde négatif',
'credit_pain' => 'Crédit pain'
'credit_pain' => 'Crédit pain',
'actif' => 'Actif'
];
}
@@ -86,6 +87,7 @@ class Etablissement extends \yii\db\ActiveRecord
{
$etablissements_dispos = Etablissement::find()
->where(['actif' => 1])
->orderby('code_postal, ville ASC')
->all() ;

+ 2
- 16
common/models/User.php 查看文件

@@ -243,26 +243,15 @@ class User extends ActiveRecord implements IdentityInterface
public function getEtablissementsFavoris()
{
$etabs = (new \yii\db\Query())
->select('*')
->from(['user_etablissement', 'etablissement'])
->where('user_etablissement.id_etablissement = etablissement.id')
->andWhere(['user_etablissement.id_user' => $this->id])
->andWhere(['user_etablissement.actif' => 1])
->all();
$arr_etabs = array() ;
->all();
foreach($etabs as $e)
{
$etablissement = Etablissement::findOne($e['id_etablissement']) ;
if($etablissement->etatPaiement() == Etablissement::PAIEMENT_OK || $etablissement->etatPaiement() == Etablissement::PAIEMENT_ESSAI)
{
$arr_etabs[] = $e ;
}
}
return $arr_etabs ;
return $etabs ;
}
public function etatPaiementEtablissement()
@@ -272,9 +261,6 @@ class User extends ActiveRecord implements IdentityInterface
if($etablissement)
{
return $etablissement->etatPaiement() ;
}
}

+ 17
- 0
console/migrations/m161214_153820_add_champs_etablissement_actif.php 查看文件

@@ -0,0 +1,17 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

class m161214_153820_add_champs_etablissement_actif extends Migration
{
public function up()
{
$this->addColumn('etablissement', 'actif', Schema::TYPE_BOOLEAN) ;
}

public function down()
{
$this->dropColumn('etablissement', 'actif') ;
}
}

+ 22
- 3
frontend/controllers/CommandeController.php 查看文件

@@ -16,6 +16,7 @@ use yii\helpers\Html;
use frontend\models\AddEtablissementForm;
use common\models\UserEtablissement;
use common\models\CreditHistorique ;
use yii\web\NotFoundHttpException ;

class CommandeController extends \yii\web\Controller {

@@ -226,12 +227,15 @@ class CommandeController extends \yii\web\Controller {
$this->redirect(['commande/index']) ;
}

public function actionCreate() {
public function actionCreate($id_etablissement = 0) {

$commande = new Commande;

$posts = Yii::$app->request->post();

if($id_etablissement)
$this->_verifEtablissementActif($id_etablissement) ;
if ($commande->load($posts)) {

$commande = Commande::find()->where('id_production = ' . $posts['Commande']['id_production'])->andWhere('id_user = ' . Yii::$app->user->id)->one();
@@ -253,9 +257,15 @@ class CommandeController extends \yii\web\Controller {

public function actionUpdate($id) {

$commande = Commande::find()->where(['id' => $id])->one();
$commande = Commande::find()
->with('production')
->where(['id' => $id])
->one();

if ($commande && $commande->load(Yii::$app->request->post())) {
$this->_verifEtablissementActif($commande->production->id_etablissement) ;
if ($commande && $commande->load(Yii::$app->request->post()))
{
$commande->date_update = date('Y-m-d H:i:s');
$this->gestionForm($commande);
}
@@ -266,6 +276,15 @@ class CommandeController extends \yii\web\Controller {
'commande_introuvable' => !$commande,
]));
}
public function _verifEtablissementActif($id_etablissement)
{
$etablissement = Etablissement::findOne($id_etablissement) ;
if($etablissement && !$etablissement->actif)
{
throw new NotFoundHttpException('Cet établissement est actuellement hors ligne.');
}
}

public function gestionForm($commande) {
$posts = Yii::$app->request->post();

+ 18
- 5
frontend/views/commande/_liste_etablissements.php 查看文件

@@ -21,9 +21,14 @@ use yii\helpers\Html ;
</div>
<div class="panel-body">
<h3 class="panel-title">
<?php echo Html::encode($e['nom']); ?>
<?php echo Html::encode($e['nom']); ?>
</h3>
<div class="localite"> à <?php echo Html::encode($e['ville']).' ('.Html::encode($e['code_postal']).')'; ?></div>
<div class="localite">
à <?php echo Html::encode($e['ville']).' ('.Html::encode($e['code_postal']).')'; ?>
<?php if(!$e['actif']): ?>
&bull; <span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Les commandes sont actuellement fermées pour cette boulangerie. Revenez plus tard ou prenez contact avec l'établissement.">Hors-ligne</span>
<?php endif; ?>
</div>
<?php if(isset($id_etablissement) && $e['id'] == $id_etablissement): ?>
<span class="glyphicon glyphicon-check"></span>
@@ -32,12 +37,20 @@ use yii\helpers\Html ;
<?php if($context == 'index'): ?>
<a href="<?= Yii::$app->urlManager->createUrl(['commande/remove-etablissement','id'=>$e['id']]); ?>" class="btn btn-xs btn-default remove"><span class="glyphicon glyphicon-remove"></span></a>
<?php endif; ?>
<?php
$disabled = '' ;
if(!$e['actif']):
$disabled = 'disabled="disabled"' ;
endif;
?>
<?php if($context == 'index'): ?>
<a class="btn btn-primary" href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Commander</a>
<a class="btn btn-primary" <?= $disabled; ?> href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Commander</a>
<?php elseif($context == 'commande'): ?>
<a class="btn btn-primary" href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Sélectionner</a>
<a class="btn btn-primary" <?= $disabled; ?> href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Sélectionner</a>
<?php endif; ?>
<div class="clr"></div>
<div class="heure-limite-commande">
<span data-toggle="tooltip" data-placement="bottom" title="Heure limite de commande">

Loading…
取消
儲存