Joywork/import/reservation/ReservationStateButtonsColumn.php
2026-05-22 21:21:54 +03:00

33 lines
1.3 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
class ReservationStateButtonsColumn
{
private static $links = [
Reservation::STATUS_NEW => [
['url' => 'reservation/towork', 'class' => 'towork', 'label' => 'В&nbsp;работу'],
],
Reservation::STATUS_WORK => [
['url' => 'reservation/cancel', 'class' => 'cancel', 'label' => 'Отменить'],
['url' => 'reservation/sell', 'class' => 'sell', 'label' => 'Продать'],
],
Reservation::STATUS_CANCEL => [
['url' => 'reservation/remove', 'class' => 'remove', 'label' => 'Удалить'],
],
Reservation::STATUS_BOUGHT => [
['url' => 'reservation/remove', 'class' => 'remove', 'label' => 'Удалить'],
],
Reservation::STATUS_DELETE => [],
];
public function renderDataCellContent($model)
{
$content = '';
$links = isset(self::$links[$model->status]) ? self::$links[$model->status] : [];
foreach ($links as $l) {
$content .= '<a href="#" class="' . $l['class'] . '" data-id="' . $model->id . '" style="color: black;border-bottom: 1px solid gray !important;" title="' .$l['label'] .'">' .$l['label'] .'</a>';
$content .= '<br/>';
}
return $content;
}
}