backend/group-training : improve delete&copy week

This commit is contained in:
Roland Schneider
2021-10-10 23:01:18 +02:00
parent 5fe59ff1d3
commit 50011a4e4f
14 changed files with 226 additions and 131 deletions

View File

@@ -1,33 +0,0 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
use common\modules\event\models\copy\CopyWeekSearch;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $model CopyWeekSearch */
?>
<div class="panel panel-default">
<div class="panel-heading">Másolás</div>
<div class="panel-body">
<?php $form = ActiveForm::begin(['options' =>['class' => 'form-inline' ]]); ?>
<?= $form->field($model, 'sourceDateString')->hiddenInput()->label(false) ?>
<?= $form->field($model, 'targetDateString')->hiddenInput()->label(false) ?>
<div class="form-group">
<label for="inpSourceEvent">Forrás hét: </label>
<input type="text" id="inpSourceEvent" disabled class="form-control" value="<?=$model->sourceTimeTable->getWeekByIndex(0)->getWeekString()?>">
</div>
<div class="form-group">
<label for="inpTargetEvent">Cél hét:</label>
<input type="text" id="inpTargetEvent" disabled class="form-control" value="<?=$model->targetTimeTable->getWeekByIndex(0)->getWeekString()?>">
</div>
<?= Html::submitButton( 'Másol', ['class' => 'btn btn-success' ]) ?>
<?php ActiveForm::end(); ?>
</div>
</div>

View File

@@ -1,7 +1,10 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
use common\modules\event\models\copy\CopyWeekContext;
use common\modules\event\models\copy\CopyWeekSearch;
use common\modules\event\widgets\timetable\TimeTableMonthView;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $tableHeaders string */
@@ -12,11 +15,56 @@ use common\modules\event\widgets\timetable\TimeTableMonthView;
<?php
echo $this->render('_copy_week_search', ['model' => $model]);
echo $this->render('_copy_week_form', ['model' => $model]);
?>
<?php $form = ActiveForm::begin(['options' =>['class' => 'form-inline' ]]); ?>
<div class="panel panel-default">
<div class="panel-heading">Másolás</div>
<div class="panel-body">
<?= $form->field($model, 'sourceDateString')->hiddenInput()->label(false) ?>
<?= $form->field($model, 'targetDateString')->hiddenInput()->label(false) ?>
<div class="form-group">
<label for="inpSourceEvent">Forrás hét: </label>
<input type="text" id="inpSourceEvent" disabled class="form-control" value="<?=$model->sourceTimeTable->getWeekByIndex(0)->getWeekString()?>">
</div>
<div class="form-group">
<label for="inpTargetEvent">Cél hét:</label>
<input type="text" id="inpTargetEvent" disabled class="form-control" value="<?=$model->targetTimeTable->getWeekByIndex(0)->getWeekString()?>">
</div>
<?= Html::submitButton( 'Forrás hét másolása', ['class' => 'btn btn-success', 'value' => 'copy', 'name' => 'command' ]) ?>
<?= Html::submitButton( 'Forrás hét törlése', ['class' => 'btn btn-danger', 'value' => 'delete', 'name' => 'command' ]) ?>
<p>
<small>
Ha egy esemény sincsen kiválasztva, akkor a másolás/törlés, minden eseményt érinteni fog.
(Nincs esemény kiválasztva = Minden esemény kiválasztva)
</small>
</p>
<p>
<small>Ha valamelyik esemény ki van választva, akkor a másolás/törlés, csak a kiválasztott esemény(eke)t fogja érinteni</small>
</p>
<p>
<small><strong>Esemény törlése:</strong> a már regisztrált vendégek kártyájára visszakerül az alkalom</small>
</p>
</div>
</div>
<h2>Forrás hét</h2>
<?= TimeTableMonthView::widget(['timeTable' => $model->sourceTimeTable]) ?>
<?= TimeTableMonthView::widget(
[
'timeTable' => $model->sourceTimeTable,
'copyWeekContext' =>new CopyWeekContext(
[
'copyWeekForm' => $form,
'copyWeekFormModel' => $model
]
)
]
) ?>
<?php ActiveForm::end(); ?>
<h2>Cél hét</h2>
<?= TimeTableMonthView::widget(['timeTable' => $model->targetTimeTable]) ?>