Browse Source

Merge branch 'dev'

prodstable
Guillaume Bourgeois 5 years ago
parent
commit
33ea1972e2
7 changed files with 67 additions and 42 deletions
  1. +14
    -0
      backend/controllers/DistributionController.php
  2. +0
    -11
      backend/controllers/OrderController.php
  3. +1
    -0
      backend/views/distribution/index.php
  4. +36
    -30
      backend/web/css/screen.css
  5. +9
    -0
      backend/web/js/vuejs/distribution-index.js
  6. +6
    -0
      backend/web/sass/distribution/_index.scss
  7. +1
    -1
      common/config/main.php

+ 14
- 0
backend/controllers/DistributionController.php View File

*/ */
public function actionAjaxProcessActiveWeekDistribution($date, $active) public function actionAjaxProcessActiveWeekDistribution($date, $active)
{ {
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$week = sprintf('%02d',date('W',strtotime($date))); $week = sprintf('%02d',date('W',strtotime($date)));
$start = strtotime(date('Y',strtotime($date)).'W'.$week); $start = strtotime(date('Y',strtotime($date)).'W'.$week);
$dateMonday = date('Y-m-d',strtotime('Monday',$start)) ; $dateMonday = date('Y-m-d',strtotime('Monday',$start)) ;
return ['success'] ; return ['success'] ;
} }
/**
* Ajoute les commandes récurrentes pour une date donnée.
*
* @param string $date
*/
public function actionAjaxProcessAddSubscriptions($date)
{
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
Subscription::addAll($date, true);
return ['success'] ;
}
} }

+ 0
- 11
backend/controllers/OrderController.php View File

]; ];
} }
/**
* Ajoute les commandes récurrentes pour une date donnée.
*
* @param string $date
*/
public function actionAddSubscriptions($date)
{
Subscription::addAll($date, true);
$this->redirect(['index', 'date' => $date]);
}

/** /**
* Change l'état d'un jour de production (activé, désactivé). * Change l'état d'un jour de production (activé, désactivé).
* *

+ 1
- 0
backend/views/distribution/index.php View File

<h3 class="panel-title">Commandes <label class="label label-success" v-if="orders.length">{{ orders.length }}</label><label class="label label-danger" v-else>0</label></h3> <h3 class="panel-title">Commandes <label class="label label-success" v-if="orders.length">{{ orders.length }}</label><label class="label label-danger" v-else>0</label></h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<button id="btn-add-subscriptions" @click="addSubscriptions" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span> Importer les abonnements</button>
<button id="btn-add-order" @click="showModalFormOrderCreate = true" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button> <button id="btn-add-order" @click="showModalFormOrderCreate = true" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button>
<order-form <order-form
v-if="showModalFormOrderCreate" v-if="showModalFormOrderCreate"

+ 36
- 30
backend/web/css/screen.css View File

right: 10px; right: 10px;
} }
/* line 193, ../sass/distribution/_index.scss */ /* line 193, ../sass/distribution/_index.scss */
.distribution-index #orders #btn-add-subscriptions {
position: absolute;
top: 9px;
right: 180px;
}
/* line 199, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale { .distribution-index #orders #wrapper-nav-points-sale {
margin-bottom: 10px; margin-bottom: 10px;
} }
/* line 196, ../sass/distribution/_index.scss */
/* line 202, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
list-style-type: none; list-style-type: none;
} }
/* line 201, ../sass/distribution/_index.scss */
/* line 207, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
/* line 207, ../sass/distribution/_index.scss */
/* line 213, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .label { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .label {
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
-webkit-border-radius: 10px; -webkit-border-radius: 10px;
border-radius: 10px; border-radius: 10px;
} }
/* line 220, ../sass/distribution/_index.scss */
/* line 226, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions { .distribution-index #orders table td.column-actions {
text-align: right; text-align: right;
width: 230px; width: 230px;
} }
/* line 224, ../sass/distribution/_index.scss */
/* line 230, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .modal-form-order, .distribution-index #orders table td.column-actions .modal-form-order,
.distribution-index #orders table td.column-actions .modal-payment { .distribution-index #orders table td.column-actions .modal-payment {
text-align: left; text-align: left;
} }
/* line 229, ../sass/distribution/_index.scss */
/* line 235, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .add-subscription { .distribution-index #orders table td.column-actions .add-subscription {
position: relative; position: relative;
} }
/* line 231, ../sass/distribution/_index.scss */
/* line 237, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .add-subscription .glyphicon-plus { .distribution-index #orders table td.column-actions .add-subscription .glyphicon-plus {
position: absolute; position: absolute;
top: 4px; top: 4px;
right: 4px; right: 4px;
font-size: 7px; font-size: 7px;
} }
/* line 240, ../sass/distribution/_index.scss */
/* line 246, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-state-payment { .distribution-index #orders table td.column-state-payment {
width: 120px; width: 120px;
} }
/* line 245, ../sass/distribution/_index.scss */
/* line 251, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-payment div.btn-group { .distribution-index #orders table td.column-payment div.btn-group {
width: 125px; width: 125px;
} }
/* line 251, ../sass/distribution/_index.scss */
/* line 257, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view ul { .distribution-index #orders table tr.view ul {
list-style-type: none; list-style-type: none;
margin-left: 0px; margin-left: 0px;
padding-left: 15px; padding-left: 15px;
} }
/* line 260, ../sass/distribution/_index.scss */
/* line 266, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view .comment { .distribution-index #orders table tr.view .comment {
margin-top: 20px; margin-top: 20px;
} }
/* line 271, ../sass/distribution/_index.scss */
/* line 277, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered td { .distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9; background-color: #e9e9e9;
} }
/* line 275, ../sass/distribution/_index.scss */
/* line 281, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered input { .distribution-index .modal-form-order table.table-products .product-ordered input {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
/* line 281, ../sass/distribution/_index.scss */
/* line 287, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity { .distribution-index .modal-form-order table.table-products td.quantity {
width: 150px; width: 150px;
} }
/* line 284, ../sass/distribution/_index.scss */
/* line 290, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input { .distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center; text-align: center;
color: gray; color: gray;
} }
/* line 290, ../sass/distribution/_index.scss */
/* line 296, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining { .distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right; text-align: right;
} }
/* line 296, ../sass/distribution/_index.scss */
/* line 302, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button { .distribution-index .modal-form-order .actions-form button {
margin-left: 15px; margin-left: 15px;
} }
/* line 304, ../sass/distribution/_index.scss */
/* line 310, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon { .distribution-index .modal-payment .info-box .info-box-icon {
width: 50px; width: 50px;
} }
/* line 306, ../sass/distribution/_index.scss */
/* line 312, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i { .distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px; font-size: 30px;
} }
/* line 310, ../sass/distribution/_index.scss */
/* line 316, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content { .distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px; margin-left: 50px;
} }
/* line 316, ../sass/distribution/_index.scss */
/* line 322, ../sass/distribution/_index.scss */
.distribution-index .modal-mask { .distribution-index .modal-mask {
position: fixed; position: fixed;
z-index: 9998; z-index: 9998;
display: table; display: table;
transition: opacity .3s ease; transition: opacity .3s ease;
} }
/* line 328, ../sass/distribution/_index.scss */
/* line 334, ../sass/distribution/_index.scss */
.distribution-index .modal-wrapper { .distribution-index .modal-wrapper {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
} }
/* line 333, ../sass/distribution/_index.scss */
/* line 339, ../sass/distribution/_index.scss */
.distribution-index .modal-container { .distribution-index .modal-container {
width: 70%; width: 70%;
margin: 0px auto; margin: 0px auto;
transition: all .3s ease; transition: all .3s ease;
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
} }
/* line 344, ../sass/distribution/_index.scss */
/* line 350, ../sass/distribution/_index.scss */
.distribution-index .modal-header { .distribution-index .modal-header {
padding-bottom: 0px; padding-bottom: 0px;
} }
/* line 346, ../sass/distribution/_index.scss */
/* line 352, ../sass/distribution/_index.scss */
.distribution-index .modal-header h3 { .distribution-index .modal-header h3 {
margin-top: 0; margin-top: 0;
color: #333; color: #333;
text-transform: uppercase; text-transform: uppercase;
margin-bottom: 0px; margin-bottom: 0px;
} }
/* line 354, ../sass/distribution/_index.scss */
/* line 360, ../sass/distribution/_index.scss */
.distribution-index .modal-body { .distribution-index .modal-body {
margin: 20px 0; margin: 20px 0;
max-height: 300px; max-height: 300px;
height: 300px; height: 300px;
overflow-y: scroll; overflow-y: scroll;
} }
/* line 361, ../sass/distribution/_index.scss */
/* line 367, ../sass/distribution/_index.scss */
.distribution-index .modal-default-button { .distribution-index .modal-default-button {
float: right; float: right;
} }
/* line 374, ../sass/distribution/_index.scss */
/* line 380, ../sass/distribution/_index.scss */
.distribution-index .modal-enter { .distribution-index .modal-enter {
opacity: 0; opacity: 0;
} }
/* line 378, ../sass/distribution/_index.scss */
/* line 384, ../sass/distribution/_index.scss */
.distribution-index .modal-leave-active { .distribution-index .modal-leave-active {
opacity: 0; opacity: 0;
} }
/* line 382, ../sass/distribution/_index.scss */
/* line 388, ../sass/distribution/_index.scss */
.distribution-index .modal-enter .modal-container, .distribution-index .modal-enter .modal-container,
.distribution-index .modal-leave-active .modal-container { .distribution-index .modal-leave-active .modal-container {
-webkit-transform: scale(1.1); -webkit-transform: scale(1.1);

+ 9
- 0
backend/web/js/vuejs/distribution-index.js View File

} }


return clone ; return clone ;
},
addSubscriptions: function() {
var app = this ;
axios.get(UrlManager.getBaseUrlAbsolute()+"distribution/ajax-process-add-subscriptions",{params: {
date: this.getDate()
}})
.then(function(response) {
app.init(app.idActivePointSale) ;
}) ;
} }
}, },
}); });

+ 6
- 0
backend/web/sass/distribution/_index.scss View File

right: 10px ; right: 10px ;
} }
#btn-add-subscriptions {
position: absolute ;
top: 9px ;
right: 180px ;
}
#wrapper-nav-points-sale { #wrapper-nav-points-sale {
margin-bottom: 10px ; margin-bottom: 10px ;

+ 1
- 1
common/config/main.php View File

'on beforeRequest' => function () { 'on beforeRequest' => function () {
if(method_exists(Yii::$app->request, 'getAbsoluteUrl')) { if(method_exists(Yii::$app->request, 'getAbsoluteUrl')) {
$url = Yii::$app->request->getAbsoluteUrl(); $url = Yii::$app->request->getAbsoluteUrl();
if (!empty($url) && substr($url, -1) == '/' && substr($url, -5) != '.net/') {
if ($_SERVER['SERVER_NAME'] != 'localhost' && !empty($url) && substr($url, -1) == '/' && substr($url, -5) != '.net/') {
$url = substr($url, 0, strlen($url) - 1); $url = substr($url, 0, strlen($url) - 1);
Yii::$app->getResponse()->redirect($url, 301); Yii::$app->getResponse()->redirect($url, 301);
Yii::$app->end(); Yii::$app->end();

Loading…
Cancel
Save