19declare(strict_types=1);
85 return !empty($this->file);
120 $clone = clone $this;
121 $clone->finalized = $finalize;
127 $clone = clone $this;
128 $clone->file =
$file;
134 DataFactory $data_factory,
139 string $record_template,
140 array $grading_options,
141 bool $may_be_edited =
true,
142 bool $place_required =
false,
143 bool $file_required =
false,
147 ->text(
$lng->txt(
'name'),
'')
153 ->textarea(
$lng->txt(
'iass_record'),
$lng->txt(
'iass_record_info'))
154 ->withValue($this->
getRecord() ?
"" : $record_template)
155 ->withDisabled(!$may_be_edited)
159 ->textarea(
$lng->txt(
'iass_internal_note'),
$lng->txt(
'iass_internal_note_info'))
161 ->withDisabled(!$may_be_edited)
165 ->file($file_handler,
$lng->txt(
'iass_upload_file'),
$lng->txt(
'iass_file_dropzone'))
167 ->withRequired($file_required)
170 $file_visible = $input
171 ->checkbox(
$lng->txt(
'iass_file_visible_examinee'))
173 ->withDisabled(!$may_be_edited)
177 ->select(
$lng->txt(
'grading'), $grading_options)
179 ->withDisabled(!$may_be_edited)
184 ->text(
$lng->txt(
'iass_place'))
186 ->withRequired($place_required)
187 ->withDisabled(!$may_be_edited)
191 ->dateTime(
$lng->txt(
'iass_event_time'))
193 ->withFormat($date_format)
194 ->withRequired($place_required)
195 ->withDisabled(!$may_be_edited)
205 ->checkbox(
$lng->txt(
'iass_notify'),
$lng->txt(
'iass_notify_explanation'))
207 ->withDisabled(!$may_be_edited)
215 'file_visible' => $file_visible,
224 ->checkbox(
$lng->txt(
'iass_finalize'),
$lng->txt(
'iass_finalize_info'))
226 ->withDisabled(!$may_be_edited)
232 return $input->section(
234 $lng->txt(
'iass_edit_record')
235 )->withAdditionalTransformation(
236 $refinery->custom()->transformation(function ($values) use ($amend) {
244 isset($values[
'file'][0]) &&
245 trim($values[
'file'][0]) !=
''
247 $file = $values[
'file'][0];
253 $values[
'internal_note'],
255 $values[
'file_visible'],
256 (
int) $values[
'learning_progress'],
258 $values[
'event_time'],
Class ilCtrlAwareUploadHandler.
withFinalized(bool $finalize)
__construct(string $name, string $record, string $internal_note, ?string $file, bool $is_file_visible, int $learning_progress, string $place, ?DateTimeImmutable $event_time, bool $notify, bool $finalized=false)
toFormInput(Field\Factory $input, DataFactory $data_factory, ilLanguage $lng, Refinery $refinery, AbstractCtrlAwareUploadHandler $file_handler, \ILIAS\Data\DateFormat\DateFormat $date_format, string $record_template, array $grading_options, bool $may_be_edited=true, bool $place_required=false, bool $file_required=false, bool $amend=false)
DateTimeImmutable $event_time
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.