Parcourir la source

[backend] Tableau de bord : pouvoir configurer le nombre de distributions affichées

dev
Guillaume il y a 4 ans
Parent
révision
d36b92a2b7
4 fichiers modifiés avec 39 ajouts et 2 suppressions
  1. +3
    -1
      backend/controllers/SiteController.php
  2. +15
    -0
      backend/views/producer/update.php
  3. +2
    -1
      common/models/Producer.php
  4. +19
    -0
      console/migrations/m201116_104905_add_option_dashboard_number_distributions.php

+ 3
- 1
backend/controllers/SiteController.php Voir le fichier

@@ -118,6 +118,8 @@ class SiteController extends BackendController
public function actionIndex()
{
// commandes
$optionDashboardNumberDistributions = Producer::getConfig('option_dashboard_number_distributions') ;
$dashboardNumberDistributions = $optionDashboardNumberDistributions ? $optionDashboardNumberDistributions : 3 ;
$distributionsArray = Distribution::find()
->with('order')
->where(['>=', 'distribution.date', date('Y-m-d')])
@@ -126,7 +128,7 @@ class SiteController extends BackendController
'distribution.active' => 1
])
->orderBy('date ASC')
->limit(3)
->limit($dashboardNumberDistributions)
->all();

// dernières commandes

+ 15
- 0
backend/views/producer/update.php Voir le fichier

@@ -107,6 +107,20 @@ $this->addBreadcrumb($this->getTitle()) ;
Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK => 'Jours de la semaine',
Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS => 'Distributions à venir',
]); ?>

<?= $form->field($model, 'option_dashboard_number_distributions')
->dropDownList([
3 => '3',
6 => '6',
9 => '9',
12 => '12',
15 => '15',
18 => '18',
21 => '21',
24 => '24',
27 => '27',
30 => '30',
], []); ?>
</div>
</div>
@@ -369,3 +383,4 @@ $this->addBreadcrumb($this->getTitle()) ;





+ 2
- 1
common/models/Producer.php Voir le fichier

@@ -115,7 +115,7 @@ class Producer extends ActiveRecordCommon
[['order_delay', 'order_deadline', 'order_delay_monday', 'order_deadline_monday', 'order_delay_tuesday', 'order_deadline_tuesday',
'order_delay_wednesday', 'order_deadline_wednesday', 'order_delay_thursday', 'order_deadline_thursday', 'order_delay_friday',
'order_deadline_friday', 'order_delay_saturday', 'order_deadline_saturday', 'order_delay_sunday', 'order_deadline_sunday',
'id_tax_rate_default', 'document_quotation_duration'], 'integer'],
'id_tax_rate_default', 'document_quotation_duration', 'option_dashboard_number_distributions'], 'integer'],
[['order_deadline', 'order_deadline_monday', 'order_deadline_tuesday', 'order_deadline_wednesday',
'order_deadline_thursday', 'order_deadline_friday', 'order_deadline_saturday',
'order_deadline_sunday', ], 'in', 'range' => [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]],
@@ -216,6 +216,7 @@ class Producer extends ActiveRecordCommon
'option_payment_info' => 'Informations liées au paiement',
'option_email_confirm' => 'Envoyer un email de confirmation au client',
'option_email_confirm_producer' => 'Envoyer un email de confirmation au producteur',
'option_dashboard_number_distributions' => 'Nombre de distributions affichées sur le tableau de board',
];
}


+ 19
- 0
console/migrations/m201116_104905_add_option_dashboard_number_distributions.php Voir le fichier

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

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

class m201116_104905_add_option_dashboard_number_distributions extends Migration
{
public function safeUp()
{
$this->addColumn('producer', 'option_dashboard_number_distributions', Schema::TYPE_INTEGER.' DEFAULT 3');
}

public function safeDown()
{
$this->dropColumn('producer', 'option_dashboard_number_distributions');

return false;
}
}

Chargement…
Annuler
Enregistrer