/** * @inheritdoc */ public function rules() { return [['data', 'date', 'format' => 'yyyy-MM-dd'], ['nomer', 'in', 'range' => range(1, Day::$zanyatiyaMax)], ['prepodavatel', 'integer'], ['auditoriya_id', 'integer'], ['auditoriya_nazvanie', NazvanieValidator::className()], ['forma', Enum2Validator::className(), 'enum' => FormaZanyatiya::className()]]; }
/** * @param string $dayData * @param integer $nomer * @param Zanyatie|null $zanyatie * @return string */ private function renderRow($dayData, $nomer, $zanyatie) { $cols = ''; if ($nomer == 1) { $cols .= $this->renderDataCell($dayData); } $renderText = [$this, 'renderTextContent']; $renderDropDown = [$this, 'renderDropDownContent']; $renderPrepodavatel = [$this, 'renderPrepodavatelContent']; $renderAuditoriya = [$this, 'renderAuditoriyaContent']; $renderTemaContent = [$this, 'renderTemaContent']; $cols .= $this->renderTimeCell($nomer, $this->kurs->status_raspisaniya == StatusRaspisaniyaKursa::REDAKTIRUETSYA) . $this->renderBlankCell($zanyatie, $this->kurs->status_raspisaniya == StatusRaspisaniyaKursa::REDAKTIRUETSYA) . $this->renderContentCell($zanyatie, $renderTemaContent) . $this->renderContentCell($zanyatie, $renderText, 'tema_tip_raboty_nazvanie'); if ($this->kurs->status_raspisaniya == StatusRaspisaniyaKursa::REDAKTIRUETSYA) { $cols .= $this->renderContentCell($zanyatie, $renderDropDown, 'forma', FormaZanyatiya::names()) . $this->renderContentCell($zanyatie, $renderPrepodavatel, 'prepodavatel', $this->prepodavateli) . $this->renderContentCell($zanyatie, $renderAuditoriya, 'auditoriya_id', $this->auditorii, 'auditoriya_nazvanie') . $this->renderResetButtonCell($zanyatie); } else { $cols .= $this->renderTextCell($zanyatie ? FormaZanyatiya::names()[$zanyatie->forma] : '') . $this->renderTextCell($zanyatie ? $this->prepodavateli[$zanyatie->prepodavatel] : '') . $this->renderTextCell($zanyatie && $zanyatie->auditoriya_id ? $this->auditorii[$zanyatie->auditoriya_id] : '', ['class' => 'center']) . '<td> </td>'; } return Html::tag('tr', $cols, ['data' => ['data' => $dayData, 'nomer' => $nomer]]); }
<?php /** * @var $kurs \app\records\Kurs * @var $schedule array */ $this->title = 'Расписание курса "' . $kurs->nazvanie . '"'; $formyZanyatyj = \app\enums2\FormaZanyatiya::names(); ?> <h3>Расписание курса "<?php echo $kurs->nazvanie; ?> "</h3> <?php foreach ($schedule as $date => $list) { ?> <h4><?php echo \app\globals\ApiGlobals::dateToStr($date); ?> </h4> <table class="tb"> <thead> <tr> <td class="center">Время</td> <td style="width: 400px;" class="center">Тема</td> <td class="center">Вид занятий</td> <td class="center">Форма занятий</td> <td class="center">Преподаватель</td>
/** * @param string $dayData * @param integer $nomer * @param Zanyatie|null $zanyatie * @return string */ private function renderRow($dayData, $nomer, $zanyatie) { $cols = ''; if ($nomer == 1) { $cols .= $this->renderDataCell($dayData); } $renderText = [$this, 'renderTextContent']; $renderDropDown = [$this, 'renderDropDownContent']; $renderPrepodavatel = [$this, 'renderPrepodavatelContent']; $renderAuditoriya = [$this, 'renderAuditoriyaContent']; $renderTemaContent = [$this, 'renderTemaContent']; $cols .= $this->renderTimeCell($nomer) . $this->renderBlankCell($zanyatie) . $this->renderContentCell($zanyatie, $renderTemaContent) . $this->renderContentCell($zanyatie, $renderText, 'tema_tip_raboty_nazvanie') . $this->renderContentCell($zanyatie, $renderDropDown, 'forma', FormaZanyatiya::names()) . $this->renderContentCell($zanyatie, $renderPrepodavatel, 'prepodavatel', $this->prepodavateli) . $this->renderContentCell($zanyatie, $renderAuditoriya, 'auditoriya_id', $this->auditorii, 'auditoriya_nazvanie') . $this->renderResetButtonCell($zanyatie); return Html::tag('tr', $cols, ['data' => ['data' => $dayData, 'nomer' => $nomer]]); }