fix clear and copy week

This commit is contained in:
2019-11-05 16:58:25 +01:00
committed by Roland Schneider
parent 9c0e2a56ee
commit 2c5db234ce
19 changed files with 692 additions and 142 deletions

View File

@@ -11,64 +11,67 @@ use common\modules\event\widgets\timetable\TimeTableMonthView;
use yii\grid\ActionColumn;
use yii\grid\GridView;
$columns = [
[
'attribute' => 'weekNumber',
'label' => '',
'value' => static function ($model,$key){
return $model->weekNumber;
}
],
[
'attribute' => 'monday',
'label' => 'Hétfő',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('monday')
],
[
'attribute' => 'tuesday',
'label' => 'Kedd',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('tuesday')
],
[
'attribute' => 'wednesday',
'label' => 'Szerda',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('wednesday')
],
[
'attribute' => 'thursday',
'label' => 'Csütörtök',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('thursday')
],
[
'attribute' => 'friday',
'label' => 'Péntek',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('friday')
],
[
'attribute' => 'saturday',
'format' => 'raw',
'label' => 'Szombat',
'value' => TimeTableMonthView::renderDay('saturday')
],
[
'attribute' => 'Sunday',
'label' => 'Vasárnap',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('sunday')
],
];
if ( isset($actionsColumn)){
$columns[] = $actionsColumn;
}
?>
<?= GridView::widget([
'dataProvider' => $timeTable->getWeeksArrayDataProvider(),
'layout' => '{items}',
'columns' => [
[
'attribute' => 'weekNumber',
'label' => '',
'value' => static function ($model,$key){
return $model->weekNumber;
}
],
[
'attribute' => 'monday',
'label' => 'Hétfő',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('monday')
],
[
'attribute' => 'tuesday',
'label' => 'Kedd',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('tuesday')
],
[
'attribute' => 'wednesday',
'label' => 'Szerda',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('wednesday')
],
[
'attribute' => 'thursday',
'label' => 'Csütörtök',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('thursday')
],
[
'attribute' => 'friday',
'label' => 'Péntek',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('friday')
],
[
'attribute' => 'saturday',
'format' => 'raw',
'label' => 'Szombat',
'value' => TimeTableMonthView::renderDay('saturday')
],
[
'attribute' => 'Sunday',
'label' => 'Vasárnap',
'format' => 'raw',
'value' => TimeTableMonthView::renderDay('sunday')
],
[
'class' => ActionColumn::class,
'template' => '{view} {update}',
],
],
'columns' => $columns,
]) ?>