Skip to content

Commit

Permalink
Fixed tariff column for manager view in Servers
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid authored and SilverFire committed Apr 2, 2019
1 parent d13b924 commit 82b77b5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/grid/ServerGridView.php
Expand Up @@ -58,7 +58,7 @@ public function init()
$this->view->registerCss('
.tariff-chain {
list-style: none;
background-color: #f5f5f5;
background-color: transparent;
}
.tariff-chain > li {
display: inline-block;
Expand All @@ -81,8 +81,7 @@ protected function formatTariff($model)
foreach ($model->sales as $sale) {
$models[] = $sale;
}
}
if ($user->can('plan.manager')) {
} elseif ($user->can('plan.manager')) {
if (!empty($model->parent_tariff)) {
$title = $model->parent_tariff;
} else {
Expand All @@ -91,7 +90,10 @@ protected function formatTariff($model)

$models[] = new Sale(['tariff' => $title, 'tariff_id' => $model->tariff_id]);
} else {
$models[] = new Sale(['tariff' => !empty($model->parent_tariff) ? $model->parent_tariff : $model->tariff]);
$models[] = new Sale([
'tariff' => $model->tariff,
'tariff_id' => $model->tariff_id,
]);
}

foreach ($models as $model) {
Expand Down

0 comments on commit 82b77b5

Please sign in to comment.