40 string $formAction =
'',
41 string $saveCommand =
'saveDocument',
42 string $cancelCommand =
'showDocuments' 59 $this->check_input_called = $status;
62 protected function initForm():
void 64 if ($this->assignment->getId() > 0) {
65 $this->
setTitle($this->
lng->txt(
'acc_form_edit_criterion_head'));
67 $this->
setTitle($this->
lng->txt(
'acc_form_attach_criterion_head'));
73 $document->setValue($this->document->getTitle());
77 if ($this->criterionTypeFactory->hasOnlyOneCriterion()) {
79 $criteriaSelection->setRequired(
true);
80 $criteriaSelection->setValue($this->assignment->getCriterionId());
82 foreach ($this->criterionTypeFactory->getTypesByIdentMap() as $criterion) {
84 if (!$this->assignment->getId()) {
85 $criteriaSelection->setValue($criterion->getTypeIdent());
88 $criterionGui = $criterion->ui($this->
lng);
89 if ($this->assignment->getCriterionId() == $criterion->getTypeIdent()) {
90 $languageSelection = $criterionGui->getSelection($this->assignment->getCriterionValue());
94 $this->
addItem($languageSelection);
99 $criteriaSelection->setValue($this->assignment->getCriterionId());
102 foreach ($this->criterionTypeFactory->getTypesByIdentMap() as $criterion) {
104 if (!$this->assignment->getId() && $first) {
105 $criteriaSelection->setValue($criterion->getTypeIdent());
109 $criterionGui = $criterion->ui($this->
lng);
110 if ($this->assignment->getCriterionId() == $criterion->getTypeIdent()) {
111 $criterionGui->appendOption(
113 $this->assignment->getCriterionValue()
120 $this->
addItem($criteriaSelection);
128 return strlen($this->translatedError) > 0;
147 $this->criterionTypeFactory,
153 if (!$uniqueAssignmentConstraint->accepts($this->assignment)) {
154 $this->
getItemByPostVar(
'criterion')->setAlert($this->
lng->txt(
'acc_criterion_assignment_must_be_unique_insert'));
155 if ($this->assignment->getId() > 0) {
156 $this->
getItemByPostVar(
'criterion')->setAlert($this->
lng->txt(
'acc_criterion_assignment_must_be_unique_update'));
159 $this->translatedError = $this->
lng->txt(
'form_input_not_valid');
164 if (!$this->assignment->getId()) {
165 $this->document->attachCriterion($this->assignment);
167 $this->document->save();
179 $criterionType = $this->criterionTypeFactory->findByTypeIdent($this->
getInput(
'criterion'));
180 $criterionGui = $criterionType->ui($this->
lng);
182 $this->assignment->setCriterionId($criterionType->getTypeIdent());
183 $this->assignment->setCriterionValue($criterionGui->getConfigByForm($this));
185 if ($this->assignment->getId() > 0) {
186 $this->assignment->setLastModifiedUsrId($this->actor->getId());
188 $this->assignment->setOwnerUsrId($this->actor->getId());
192 $this->translatedError = $this->
lng->txt(
'form_input_not_valid');
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilAccessibilityDocumentCriterionAssignmentConstraint.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...