backend: add colors to event_type index.php; fix timetable dates
This commit is contained in:
@@ -13,4 +13,11 @@ class AppDateTimeHelper
|
||||
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('room', 'event.id_room = room.id');
|
||||
$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(
|
||||
[
|
||||
'event_id',
|
||||
|
||||
@@ -16,7 +16,7 @@ if ( $permissions->allowCreate ){
|
||||
$indexTableTemplateButtons[] = '{update}';
|
||||
}
|
||||
$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);
|
||||
},
|
||||
'equipment-types-assignment' => function ($url, $model, $key) {
|
||||
$options = [
|
||||
'title' => Yii::t('yii', 'Equipment Types'),
|
||||
'aria-label' => Yii::t('yii', 'Equipment Types'),
|
||||
'data-pjax' => '0',
|
||||
];
|
||||
return Html::a('<span class="glyphicon glyphicon-wrench"></span>', $url, $options);
|
||||
}
|
||||
// 'equipment-types-assignment' => function ($url, $model, $key) {
|
||||
// $options = [
|
||||
// 'title' => Yii::t('yii', 'Equipment Types'),
|
||||
// 'aria-label' => Yii::t('yii', 'Equipment Types'),
|
||||
// 'data-pjax' => '0',
|
||||
// ];
|
||||
// return Html::a('<span class="glyphicon glyphicon-wrench"></span>', $url, $options);
|
||||
// }
|
||||
]
|
||||
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace common\modules\event\widgets\event;
|
||||
use common\helpers\AppDateTimeHelper;
|
||||
use common\models\Event;
|
||||
use DateTime;
|
||||
use yii\bootstrap\Widget;
|
||||
@@ -20,10 +21,8 @@ class EventView extends Widget
|
||||
public function init(){
|
||||
parent::init();
|
||||
if ( isset($this->event )){
|
||||
$this->start = new DateTime();
|
||||
$this->start->setTimestamp($this->event->start);
|
||||
$this->end = new DateTime();
|
||||
$this->end->setTimestamp($this->event->end);
|
||||
$this->start = AppDateTimeHelper::convertUnixTimeToDateTime($this->event->start);
|
||||
$this->end = AppDateTimeHelper::convertUnixTimeToDateTime($this->event->end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user