Преглед на файлове

Heure limite de commande

Ajout de la possibilité pour le boulanger de configurer l'heure limite de commande dans ses paramètres.
Adaptation du formulaire de commande et de la mise en page des boulangeries sur le frontend.
master
keun преди 8 години
родител
ревизия
ce680fb618
променени са 9 файла, в които са добавени 148 реда и са изтрити 82 реда
  1. +1
    -2
      backend/controllers/EtablissementController.php
  2. +11
    -1
      backend/views/etablissement/update.php
  3. +5
    -1
      common/models/Etablissement.php
  4. +17
    -0
      console/migrations/m161117_133153_add_champs_etablissement_heure_limite_commande.php
  5. +7
    -2
      frontend/controllers/CommandeController.php
  6. +4
    -0
      frontend/views/commande/_liste_etablissements.php
  7. Двоични данни
      frontend/web/.sass-cache/e1a48ee3204d3a535cdbe440c2995954a615ac19/_systeme_commandes.scssc
  8. +90
    -76
      frontend/web/css/screen.css
  9. +13
    -0
      frontend/web/sass/_systeme_commandes.scss

+ 1
- 2
backend/controllers/EtablissementController.php Целия файл

@@ -49,9 +49,8 @@ class EtablissementController extends BackendController
$model = $this->findModel(Yii::$app->user->identity->id_etablissement);
$logo_filename_old = $model->logo ;
$photo_filename_old = $model->photo ;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
Upload::uploadFile($model, 'logo', $logo_filename_old) ;
Upload::uploadFile($model, 'photo', $photo_filename_old) ;

+ 11
- 1
backend/views/etablissement/update.php Целия файл

@@ -18,7 +18,17 @@ $this->params['breadcrumbs'][] = 'Paramètres';
<?= $form->field($model, 'ville') ?>
<?= $form->field($model, 'code')->hint("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.") ?>
<?php //$form->field($model, 'description')->textarea(['rows' => 10]) ?>
<?= $form->field($model, 'heure_limite_commande')
->dropDownList([
24 => 'Minuit',
23 => '23h',
22 => '22h',
21 => '21h',
20 => '20h',
19 => '19h',
18 => '18h',
], [])
->hint('Heure limite jusqu\'à laquelle les clients peuvent commander pour le lendemain.') ; ?>
<?= $form->field($model, 'photo')->fileInput() ?>
<?php
if (strlen($model->photo)) {

+ 5
- 1
common/models/Etablissement.php Целия файл

@@ -39,7 +39,9 @@ class Etablissement extends \yii\db\ActiveRecord
public function rules()
{
return [
[['nom', 'siret','code'], 'required'],
[['nom', 'siret','code', 'heure_limite_commande'], 'required'],
['heure_limite_commande','integer'],
['heure_limite_commande','in', 'range' => [18, 19, 20, 21, 22, 23, 24]],
['code', function($attribute, $params)
{
$code = $this->$attribute ;
@@ -70,6 +72,8 @@ class Etablissement extends \yii\db\ActiveRecord
'description' => 'Description',
'code_postal' => 'Code postal',
'ville' => 'Ville',
'code' => 'Code',
'heure_limite_commande' => 'Heure limite de commande'
];
}

+ 17
- 0
console/migrations/m161117_133153_add_champs_etablissement_heure_limite_commande.php Целия файл

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

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

class m161117_133153_add_champs_etablissement_heure_limite_commande extends Migration
{
public function up()
{
$this->addColumn('etablissement', 'heure_limite_commande', Schema::TYPE_FLOAT.' DEFAULT 0') ;
}

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

+ 7
- 2
frontend/controllers/CommandeController.php Целия файл

@@ -71,8 +71,13 @@ class CommandeController extends \yii\web\Controller {
->all();
$arr_points_vente = $points_vente;

// jours de production;
if (date('H') >= 20) {
// jours de production
$heure_limite = 20 ;
if(isset($etablissement))
{
$heure_limite = $etablissement->heure_limite_commande ;
}
if (date('H') >= $heure_limite) {
$date = date('Y-m-d', strtotime(date('Y-m-d')) + 60 * 60 * 24);
} else {
$date = date('Y-m-d');

+ 4
- 0
frontend/views/commande/_liste_etablissements.php Целия файл

@@ -37,6 +37,10 @@ use yii\helpers\Html ;
<?php elseif($context == 'commande'): ?>
<a class="btn btn-primary" href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Sélectionner</a>
<?php endif; ?>
<div class="heure-limite-commande" data-toggle="tooltip" data-placement="bottom" title="Heure limite de commande pour le lendemain">
<span class="limite"><span class="glyphicon glyphicon-time"></span> Heure limite :</span> <?php echo Html::encode($e['heure_limite_commande']) ?> h
</div>
</div>
</div>
</div>

Двоични данни
frontend/web/.sass-cache/e1a48ee3204d3a535cdbe440c2995954a615ac19/_systeme_commandes.scssc Целия файл


+ 90
- 76
frontend/web/css/screen.css Целия файл

@@ -618,12 +618,26 @@ h2 {
background-color: white;
padding: 10px 20px;
}
/* line 103, ../sass/_systeme_commandes.scss */
.liste-etablissements .boulangerie .panel-body .heure-limite-commande {
position: absolute;
bottom: 0px;
right: 0px;
padding: 10px;
border-top: solid 1px #ddd;
border-left: solid 1px #ddd;
font-size: 12px;
}
/* line 111, ../sass/_systeme_commandes.scss */
.liste-etablissements .boulangerie .panel-body .heure-limite-commande .limite {
font-weight: bold;
}

/* line 106, ../sass/_systeme_commandes.scss */
/* line 119, ../sass/_systeme_commandes.scss */
#index-commande {
position: relative;
}
/* line 109, ../sass/_systeme_commandes.scss */
/* line 122, ../sass/_systeme_commandes.scss */
#index-commande #logout {
position: absolute;
/*top: 45px ;
@@ -632,122 +646,122 @@ h2 {
right: 0;
z-index: 10;
}
/* line 118, ../sass/_systeme_commandes.scss */
/* line 131, ../sass/_systeme_commandes.scss */
#index-commande .accueil {
text-align: center;
padding-bottom: 20px;
}
/* line 123, ../sass/_systeme_commandes.scss */
/* line 136, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement {
padding-left: 0px;
padding-right: 30px;
}
/* line 127, ../sass/_systeme_commandes.scss */
/* line 140, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement .help-block {
padding-bottom: 0px;
}
/* line 131, ../sass/_systeme_commandes.scss */
/* line 144, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement .field-addetablissementform-id_etablissement {
width: 80%;
float: left;
}
/* line 136, ../sass/_systeme_commandes.scss */
/* line 149, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement .field-addetablissementform-code {
width: 70%;
float: left;
}
/* line 141, ../sass/_systeme_commandes.scss */
/* line 154, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement .btn {
float: right;
position: relative;
top: 20px;
}
/* line 147, ../sass/_systeme_commandes.scss */
/* line 160, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement .panel-heading {
background: none;
background-color: white;
cursor: pointer;
}
/* line 153, ../sass/_systeme_commandes.scss */
/* line 166, ../sass/_systeme_commandes.scss */
#index-commande #bloc-add-etablissement .panel-body {
display: none;
}
/* line 159, ../sass/_systeme_commandes.scss */
/* line 172, ../sass/_systeme_commandes.scss */
#index-commande #addetablissementform-id_etablissement option:disabled {
font-weight: bold;
color: black;
}
/* line 166, ../sass/_systeme_commandes.scss */
/* line 179, ../sass/_systeme_commandes.scss */
#index-commande #historique-commandes .statut, #index-commande #historique-commandes .montant {
width: 175px;
}
/* line 169, ../sass/_systeme_commandes.scss */
/* line 182, ../sass/_systeme_commandes.scss */
#index-commande #historique-commandes .montant {
width: 100px;
}
/* line 176, ../sass/_systeme_commandes.scss */
/* line 189, ../sass/_systeme_commandes.scss */
#index-commande #historique-commandes .localite {
font-size: 11px;
lin-height: 11px;
}
/* line 181, ../sass/_systeme_commandes.scss */
/* line 194, ../sass/_systeme_commandes.scss */
#index-commande #historique-commandes a {
text-decoration: none;
}

/* line 188, ../sass/_systeme_commandes.scss */
/* line 201, ../sass/_systeme_commandes.scss */
.commande-form {
min-height: 600px;
padding-bottom: 60px;
}
/* line 193, ../sass/_systeme_commandes.scss */
/* line 206, ../sass/_systeme_commandes.scss */
.commande-form h2 {
font-family: "myriadpro-regular";
}
/* line 197, ../sass/_systeme_commandes.scss */
/* line 210, ../sass/_systeme_commandes.scss */
.commande-form #infos-importantes.alert-warning {
float: right;
}
/* line 203, ../sass/_systeme_commandes.scss */
/* line 216, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-datepicker {
float: left;
margin-right: 20px;
font-size: 20px;
}
/* line 209, ../sass/_systeme_commandes.scss */
/* line 222, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-datepicker-header {
background-color: #BB8757;
}
/* line 213, ../sass/_systeme_commandes.scss */
/* line 226, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-datepicker-title {
color: white;
}
/* line 219, ../sass/_systeme_commandes.scss */
/* line 232, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-datepicker-prev:hover,
.commande-form #datepicker-production .ui-datepicker-next:hover {
border: 0px none;
background: none;
}
/* line 225, ../sass/_systeme_commandes.scss */
/* line 238, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-helper-clearfix:after {
clear: none;
}
/* line 230, ../sass/_systeme_commandes.scss */
/* line 243, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-datepicker-calendar a {
text-decoration: none;
background-color: #F8F1DD;
}
/* line 233, ../sass/_systeme_commandes.scss */
/* line 246, ../sass/_systeme_commandes.scss */
.commande-form #datepicker-production .ui-datepicker-calendar a.ui-state-hover, .commande-form #datepicker-production .ui-datepicker-calendar a.ui-state-active {
background-color: #BB8757;
color: white;
border-color: #cdc3b7;
}
/* line 242, ../sass/_systeme_commandes.scss */
/* line 255, ../sass/_systeme_commandes.scss */
.commande-form .date-commande {
margin-bottom: 53px;
}
/* line 244, ../sass/_systeme_commandes.scss */
/* line 257, ../sass/_systeme_commandes.scss */
.commande-form .date-commande span {
background-color: #BB8757;
color: white;
@@ -758,47 +772,47 @@ h2 {
font-family: "myriadpro-regular";
font-size: 20px;
}
/* line 254, ../sass/_systeme_commandes.scss */
/* line 267, ../sass/_systeme_commandes.scss */
.commande-form #has-commande-en-cours {
margin-top: 15px;
}
/* line 257, ../sass/_systeme_commandes.scss */
/* line 270, ../sass/_systeme_commandes.scss */
.commande-form #has-commande-en-cours a {
color: #a94442;
text-decoration: none;
font-weight: bold;
}
/* line 264, ../sass/_systeme_commandes.scss */
/* line 277, ../sass/_systeme_commandes.scss */
.commande-form .field-commande-id_production {
display: none;
}
/* line 268, ../sass/_systeme_commandes.scss */
/* line 281, ../sass/_systeme_commandes.scss */
.commande-form .field-commande-id_point_vente {
margin-top: 30px;
}
/* line 272, ../sass/_systeme_commandes.scss */
/* line 285, ../sass/_systeme_commandes.scss */
.commande-form .field-commande-id_production {
margin-bottom: 0px;
}
/* line 274, ../sass/_systeme_commandes.scss */
/* line 287, ../sass/_systeme_commandes.scss */
.commande-form .field-commande-id_production label {
margin-bottom: 0px;
}
/* line 278, ../sass/_systeme_commandes.scss */
/* line 291, ../sass/_systeme_commandes.scss */
.commande-form .field-commande-id_production .help-block {
margin-bottom: 0px;
}
/* line 283, ../sass/_systeme_commandes.scss */
/* line 296, ../sass/_systeme_commandes.scss */
.commande-form .field-commande-id_point_vente {
display: none;
}
/* line 287, ../sass/_systeme_commandes.scss */
/* line 300, ../sass/_systeme_commandes.scss */
.commande-form .blocs {
list-style-type: none;
margin: 0px;
padding: 0px;
}
/* line 292, ../sass/_systeme_commandes.scss */
/* line 305, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc {
text-decoration: none;
width: 268px;
@@ -813,107 +827,107 @@ h2 {
background-color: white;
border: 1px solid #d8d8d8;
}
/* line 307, ../sass/_systeme_commandes.scss */
/* line 320, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc .nom {
font-family: "comfortaalight";
font-size: 20px;
}
/* line 313, ../sass/_systeme_commandes.scss */
/* line 326, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc .adresse {
color: gray;
font-size: 13px;
line-height: 16px;
}
/* line 319, ../sass/_systeme_commandes.scss */
/* line 332, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc .horaires {
margin-top: 7px;
}
/* line 321, ../sass/_systeme_commandes.scss */
/* line 334, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc .horaires .jour {
font-weight: bold;
display: none;
}
/* line 328, ../sass/_systeme_commandes.scss */
/* line 341, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc.selected {
border-left: solid 5px #BB8757;
}
/* line 331, ../sass/_systeme_commandes.scss */
/* line 344, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc.selected .contenu {
position: relative;
left: -4px;
}
/* line 337, ../sass/_systeme_commandes.scss */
/* line 350, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc:hover {
-moz-box-shadow: 0px 0px 5px #d8d8d8;
-webkit-box-shadow: 0px 0px 5px #d8d8d8;
box-shadow: 0px 0px 5px #d8d8d8;
}
/* line 342, ../sass/_systeme_commandes.scss */
/* line 355, ../sass/_systeme_commandes.scss */
.commande-form .blocs .bloc.disabled {
display: none;
}
/* line 349, ../sass/_systeme_commandes.scss */
/* line 362, ../sass/_systeme_commandes.scss */
.commande-form #produits {
margin-top: 15px;
}
/* line 352, ../sass/_systeme_commandes.scss */
/* line 365, ../sass/_systeme_commandes.scss */
.commande-form #produits #label-produits {
display: block;
margin-bottom: 5px;
}
/* line 357, ../sass/_systeme_commandes.scss */
/* line 370, ../sass/_systeme_commandes.scss */
.commande-form #produits .table {
margin-top: 7px;
}
/* line 360, ../sass/_systeme_commandes.scss */
/* line 373, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .illu {
float: left;
height: auto;
width: 70px;
margin-right: 15px;
}
/* line 367, ../sass/_systeme_commandes.scss */
/* line 380, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .photo {
padding: 0px;
width: 120px;
}
/* line 372, ../sass/_systeme_commandes.scss */
/* line 385, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .th-photo, .commande-form #produits .table .td-photo {
width: 120px;
}
/* line 376, ../sass/_systeme_commandes.scss */
/* line 389, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .nom {
font-family: "comfortaalight";
font-weight: bold;
text-transform: uppercase;
font-size: 18px;
}
/* line 383, ../sass/_systeme_commandes.scss */
/* line 396, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .description {
font-style: italic;
}
/* line 387, ../sass/_systeme_commandes.scss */
/* line 400, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .recette {
font-size: 12px;
}
/* line 391, ../sass/_systeme_commandes.scss */
/* line 404, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .input-group {
width: 133px;
}
/* line 393, ../sass/_systeme_commandes.scss */
/* line 406, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .input-group .quantity {
text-align: center;
}
/* line 398, ../sass/_systeme_commandes.scss */
/* line 411, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .colonne-quantite, .commande-form #produits .table .prix-unit, .commande-form #produits .table .total {
width: 150px;
text-align: center;
}
/* line 403, ../sass/_systeme_commandes.scss */
/* line 416, ../sass/_systeme_commandes.scss */
.commande-form #produits .table td#total-commande, .commande-form #produits .table td#total-commande-vrac, .commande-form #produits .table td.total {
text-align: center;
}
/* line 407, ../sass/_systeme_commandes.scss */
/* line 420, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .epuise {
display: none;
text-transform: uppercase;
@@ -922,32 +936,32 @@ h2 {
font-size: 16px;
text-align: center;
}
/* line 416, ../sass/_systeme_commandes.scss */
/* line 429, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .quantite-restante {
font-size: 12px;
margin-top: 8px;
}
/* line 420, ../sass/_systeme_commandes.scss */
/* line 433, ../sass/_systeme_commandes.scss */
.commande-form #produits .table .quantite-restante .nb {
font-weight: bold;
}
/* line 425, ../sass/_systeme_commandes.scss */
/* line 438, ../sass/_systeme_commandes.scss */
.commande-form #produits .table td.produit, .commande-form #produits .table th.produit {
width: 70%;
}
/* line 429, ../sass/_systeme_commandes.scss */
/* line 442, ../sass/_systeme_commandes.scss */
.commande-form #produits .table td.prix-unit, .commande-form #produits .table th.prix-unit {
width: 10%;
}
/* line 433, ../sass/_systeme_commandes.scss */
/* line 446, ../sass/_systeme_commandes.scss */
.commande-form #produits .table td.colonne-quantite, .commande-form #produits .table th.colonne-quantite {
width: 10%;
}
/* line 437, ../sass/_systeme_commandes.scss */
/* line 450, ../sass/_systeme_commandes.scss */
.commande-form #produits .table td.total, .commande-form #produits .table th.total {
width: 10%;
}
/* line 443, ../sass/_systeme_commandes.scss */
/* line 456, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed {
display: none;
position: fixed;
@@ -967,7 +981,7 @@ h2 {
background-color: #F8F1DD;
text-align: center;
}
/* line 460, ../sass/_systeme_commandes.scss */
/* line 473, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed.not-fixed {
position: relative;
-moz-box-shadow: none;
@@ -979,7 +993,7 @@ h2 {
border: solid 1px #e0e0e0;
padding-right: 20px;
}
/* line 468, ../sass/_systeme_commandes.scss */
/* line 481, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed #total-commande-bottom {
background-color: white;
-moz-border-radius: 20px;
@@ -988,37 +1002,37 @@ h2 {
padding: 5px 25px;
border: solid 1px #e0e0e0;
}
/* line 475, ../sass/_systeme_commandes.scss */
/* line 488, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed .valider-commande, .commande-form #bar-fixed .btn-commentaire {
float: left;
}
/* line 479, ../sass/_systeme_commandes.scss */
/* line 492, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed .btn-commentaire {
margin-right: 10px;
}
/* line 483, ../sass/_systeme_commandes.scss */
/* line 496, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed .btn-retour, .commande-form #bar-fixed .annuler-commande {
float: left;
margin-right: 5px;
}
/* line 488, ../sass/_systeme_commandes.scss */
/* line 501, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed .annuler-commande {
color: #b92c28;
background-color: white;
}
/* line 493, ../sass/_systeme_commandes.scss */
/* line 506, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed #total-commande-bottom {
display: none;
font-weight: bold;
font-family: "comfortaalight";
font-size: 24px;
}
/* line 500, ../sass/_systeme_commandes.scss */
/* line 513, ../sass/_systeme_commandes.scss */
.commande-form #bar-fixed .field-commande-commentaire {
display: none;
}

/* line 508, ../sass/_systeme_commandes.scss */
/* line 521, ../sass/_systeme_commandes.scss */
.ui-datepicker .ui-widget-header {
background: none;
background-color: gray;
@@ -1026,7 +1040,7 @@ h2 {
color: black;
font-weight: normal;
}
/* line 516, ../sass/_systeme_commandes.scss */
/* line 529, ../sass/_systeme_commandes.scss */
.ui-datepicker .ui-datepicker-current-day a,
.ui-datepicker a.ui-state-hover {
background: none;

+ 13
- 0
frontend/web/sass/_systeme_commandes.scss Целия файл

@@ -99,6 +99,19 @@ h2 {
background-color: white ;
padding: 10px 20px ;
}
.heure-limite-commande {
position: absolute ;
bottom: 0px ;
right: 0px ;
padding: 10px ;
border-top: solid 1px #ddd ;
border-left: solid 1px #ddd ;
font-size: 12px ;
.limite {
font-weight: bold ;
}
}
}
}
}

Loading…
Отказ
Запис