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

parent bee57d75
......@@ -3,5 +3,21 @@
return [
'feed_conf' => [
'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(){
if (sortField) {
console.log('AAA sortField = ', sortField);
console.log('AAA dataTable = ', dataTable);
//console.log('AAA sortField = ', sortField);
//console.log('AAA dataTable = ', dataTable);
var dataTableForSort = [];
......
......@@ -158,6 +158,8 @@ class Cabinet extends Common
$data['periodStats'] = $periodStats;
$data['campaignStats'] = $campaignStats;
$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', [
......
......@@ -60,24 +60,8 @@ $current_period = $this->current_period;
$dates = $this->dates;
$cats = $this->cats;
$report = $this->report;
$periods_conf = array(
'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',
);
$periods_list = $this->periods_list;
$colors_active_lines = $this->colors_active_lines;
$data_request_link = $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $report]);
$system_link = $this->url('adm.system.actions');
......@@ -148,7 +132,7 @@ $system_link = $this->url('adm.system.actions');
<span>период: </span>
<select class="form-control stat-period" name="period" data-link="<?=$data_request_link ?>">
<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>
<?php endforeach; ?>
</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