Skip to content

Commit

Permalink
Fixed ServerGridView to display tariff details link
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Jan 27, 2017
1 parent 3d28fc9 commit d593541
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/grid/ServerGridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ public static function setOsImages($osImages)

public static function formatTariff($model)
{
if (Yii::$app->user->can('support')) {
if ($model->parent_tariff && $model->parent_tariff !== $model->tariff) {
return Html::tag('abbr', $model->parent_tariff, ['title' => $model->tariff, 'data-toggle' => 'tooltip'])
. ' ' . Html::a('<i class="fa fa-external-link"></i>', ['@tariff/view', 'id' => $model->tariff_id]);
if (Yii::$app->user->can('manage')) {

if ($model->parent_tariff) {
$html[] = Html::tag('abbr', $model->parent_tariff, ['title' => $model->tariff, 'data-toggle' => 'tooltip']);
} else {
return $model->tariff;
$html[] = $model->tariff;
}

$html[] = Html::a('<i class="fa fa-external-link"></i>', ['@tariff/view', 'id' => $model->tariff_id]);

return implode(' ', $html);
}

return !empty($model->parent_tariff) ? $model->parent_tariff : $model->tariff;
Expand Down

0 comments on commit d593541

Please sign in to comment.