fix clear and copy week
This commit is contained in:
@@ -14,10 +14,14 @@ use yii\bootstrap\Widget;
|
||||
class TimeTableMonthView extends Widget
|
||||
{
|
||||
public $timeTable;
|
||||
public $actionsColumn;
|
||||
|
||||
|
||||
public function run() {
|
||||
return $this->render('_timetable', [ 'timeTable' => $this->timeTable]);
|
||||
return $this->render('_timetable', [
|
||||
'timeTable' => $this->timeTable,
|
||||
'actionsColumn' => ( isset($this->actionsColumn) ? $this->actionsColumn : null)
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +32,9 @@ class TimeTableMonthView extends Widget
|
||||
* @return string
|
||||
*/
|
||||
return static function ($week) use ($weekDay) {
|
||||
return TimeTableMonthDayView::widget(['day' => $week->getWeekDay($weekDay)]);
|
||||
return TimeTableMonthDayView::widget([
|
||||
'day' => $week->getWeekDay($weekDay),
|
||||
]);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
]) ?>
|
||||
|
||||
Reference in New Issue
Block a user