backend: add colors to event_type index.php; fix timetable dates
This commit is contained in:
parent
d26581e338
commit
89b3ab4ce5
@ -30,8 +30,15 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'attribute' => 'theme',
|
'attribute' => 'theme',
|
||||||
'label' => 'Színtéma',
|
'label' => 'Színtéma',
|
||||||
'value' => function ($model, $key, $index, $column){
|
'value' => function ($model, $key, $index, $column){
|
||||||
return isset($model['theme']) ? "Színtéma " . ($model['theme']+1) : "";
|
$result = "";
|
||||||
|
if ( isset( $model['theme'] )){
|
||||||
|
$box = "<span style='margin-right: 0.3rem; height: 1rem; width: 1rem; display: inline-block;' class='event-theme-active-".$model['theme']."'></span>";
|
||||||
|
$name = "Színtéma " . ($model['theme']+1);
|
||||||
|
$result = $box . $name;
|
||||||
}
|
}
|
||||||
|
return $result;
|
||||||
|
},
|
||||||
|
'format' => 'raw'
|
||||||
],
|
],
|
||||||
['class' => 'yii\grid\ActionColumn',
|
['class' => 'yii\grid\ActionColumn',
|
||||||
'template' => '{view} {update}'
|
'template' => '{view} {update}'
|
||||||
|
|||||||
@ -13,4 +13,11 @@ class AppDateTimeHelper
|
|||||||
return $unixTime;
|
return $unixTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function convertUnixTimeToDateTime($unixTime){
|
||||||
|
$result = new \DateTime();
|
||||||
|
$result->setTimestamp($unixTime);
|
||||||
|
$result->setTimeZone(new \DateTimeZone("UTC"));
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class EventSearch extends Event
|
|||||||
$query->innerJoin('trainer', 'event.id_trainer = trainer.id');
|
$query->innerJoin('trainer', 'event.id_trainer = trainer.id');
|
||||||
$query->innerJoin('room', 'event.id_room = room.id');
|
$query->innerJoin('room', 'event.id_room = room.id');
|
||||||
$query->innerJoin('event_type', 'event_type.id = event.id_event_type');
|
$query->innerJoin('event_type', 'event_type.id = event.id_event_type');
|
||||||
$query->leftJoin('event_registration', 'event_registration.id_event = event.id');
|
$query->leftJoin('event_registration', 'event_registration.id_event = event.id and event_registration.canceled_at is null and event_registration.deleted_at is null ');
|
||||||
$query->groupBy(
|
$query->groupBy(
|
||||||
[
|
[
|
||||||
'event_id',
|
'event_id',
|
||||||
|
|||||||
@ -16,7 +16,7 @@ if ( $permissions->allowCreate ){
|
|||||||
$indexTableTemplateButtons[] = '{update}';
|
$indexTableTemplateButtons[] = '{update}';
|
||||||
}
|
}
|
||||||
$indexTableTemplateButtons[] = '{reserve-card}';
|
$indexTableTemplateButtons[] = '{reserve-card}';
|
||||||
$indexTableTemplateButtons[] = '{equipment-types-assignment}';
|
//$indexTableTemplateButtons[] = '{equipment-types-assignment}';
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -155,14 +155,14 @@ $indexTableTemplateButtons[] = '{equipment-types-assignment}';
|
|||||||
];
|
];
|
||||||
return Html::a('<span class="glyphicon glyphicon-user"></span>', $url, $options);
|
return Html::a('<span class="glyphicon glyphicon-user"></span>', $url, $options);
|
||||||
},
|
},
|
||||||
'equipment-types-assignment' => function ($url, $model, $key) {
|
// 'equipment-types-assignment' => function ($url, $model, $key) {
|
||||||
$options = [
|
// $options = [
|
||||||
'title' => Yii::t('yii', 'Equipment Types'),
|
// 'title' => Yii::t('yii', 'Equipment Types'),
|
||||||
'aria-label' => Yii::t('yii', 'Equipment Types'),
|
// 'aria-label' => Yii::t('yii', 'Equipment Types'),
|
||||||
'data-pjax' => '0',
|
// 'data-pjax' => '0',
|
||||||
];
|
// ];
|
||||||
return Html::a('<span class="glyphicon glyphicon-wrench"></span>', $url, $options);
|
// return Html::a('<span class="glyphicon glyphicon-wrench"></span>', $url, $options);
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace common\modules\event\widgets\event;
|
namespace common\modules\event\widgets\event;
|
||||||
|
use common\helpers\AppDateTimeHelper;
|
||||||
use common\models\Event;
|
use common\models\Event;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use yii\bootstrap\Widget;
|
use yii\bootstrap\Widget;
|
||||||
@ -20,10 +21,8 @@ class EventView extends Widget
|
|||||||
public function init(){
|
public function init(){
|
||||||
parent::init();
|
parent::init();
|
||||||
if ( isset($this->event )){
|
if ( isset($this->event )){
|
||||||
$this->start = new DateTime();
|
$this->start = AppDateTimeHelper::convertUnixTimeToDateTime($this->event->start);
|
||||||
$this->start->setTimestamp($this->event->start);
|
$this->end = AppDateTimeHelper::convertUnixTimeToDateTime($this->event->end);
|
||||||
$this->end = new DateTime();
|
|
||||||
$this->end->setTimestamp($this->event->end);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user