Вынес в конфиг список периодов и цветов категорий

parent bee57d75
...@@ -3,5 +3,21 @@ ...@@ -3,5 +3,21 @@
return [ return [
'feed_conf' => [ 'feed_conf' => [
'formats' => ['yml', 'gfeed'], 'formats' => ['yml', 'gfeed'],
'periods_list' => [
'today' => 'сегодня',
'yesterday' => 'вчера',
'7days' => '7 дней',
'30days' => '30 дней',
'current_month' => 'текущий месяц',
'prev_month' => 'прошлый месяц',
'year' => 'год',
], ],
'colors_active_lines' => [
'shows' => '#2CA02C',
'clicks' => '#D62728',
'transactions' => '#1F77B4',
'salemoney' => '#FF7F0E',
'admoney' => '#9467BD',
]
]
]; ];
...@@ -52,8 +52,8 @@ $(document).ready(function(){ ...@@ -52,8 +52,8 @@ $(document).ready(function(){
if (sortField) { if (sortField) {
console.log('AAA sortField = ', sortField); //console.log('AAA sortField = ', sortField);
console.log('AAA dataTable = ', dataTable); //console.log('AAA dataTable = ', dataTable);
var dataTableForSort = []; var dataTableForSort = [];
......
...@@ -158,6 +158,8 @@ class Cabinet extends Common ...@@ -158,6 +158,8 @@ class Cabinet extends Common
$data['periodStats'] = $periodStats; $data['periodStats'] = $periodStats;
$data['campaignStats'] = $campaignStats; $data['campaignStats'] = $campaignStats;
$data['cats'] = $cats; $data['cats'] = $cats;
$data['periods_list'] = $this->container->get('config')['feed_conf']['periods_list'];
$data['colors_active_lines'] = $this->container->get('config')['feed_conf']['colors_active_lines'];
/* /*
$response = new HtmlResponse($this->template->render('app::user/feeds', [ $response = new HtmlResponse($this->template->render('app::user/feeds', [
......
...@@ -60,24 +60,8 @@ $current_period = $this->current_period; ...@@ -60,24 +60,8 @@ $current_period = $this->current_period;
$dates = $this->dates; $dates = $this->dates;
$cats = $this->cats; $cats = $this->cats;
$report = $this->report; $report = $this->report;
$periods_list = $this->periods_list;
$periods_conf = array( $colors_active_lines = $this->colors_active_lines;
'today' => 'сегодня',
'yesterday' => 'вчера',
'7days' => '7 дней',
'30days' => '30 дней',
'current_month' => 'текущий месяц',
'prev_month' => 'прошлый месяц',
'year' => 'год',
);
$colors_active_lines = array(
'shows' => '#2CA02C',
'clicks' => '#D62728',
'transactions' => '#1F77B4',
'salemoney' => '#FF7F0E',
'admoney' => '#9467BD',
);
$data_request_link = $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $report]); $data_request_link = $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $report]);
$system_link = $this->url('adm.system.actions'); $system_link = $this->url('adm.system.actions');
...@@ -148,7 +132,7 @@ $system_link = $this->url('adm.system.actions'); ...@@ -148,7 +132,7 @@ $system_link = $this->url('adm.system.actions');
<span>период: </span> <span>период: </span>
<select class="form-control stat-period" name="period" data-link="<?=$data_request_link ?>"> <select class="form-control stat-period" name="period" data-link="<?=$data_request_link ?>">
<option value="" disabled>--</option> <option value="" disabled>--</option>
<?php foreach($periods_conf as $period => $title): ?> <?php foreach($periods_list as $period => $title): ?>
<option value="<?=$period ?>" <?php if ($period == $current_period): ?>selected<?php endif; ?>><?=$title ?></option> <option value="<?=$period ?>" <?php if ($period == $current_period): ?>selected<?php endif; ?>><?=$title ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment