Skip to content

Commit

Permalink
fix(formanswer): restore validation status
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jul 30, 2020
1 parent 912c008 commit cc8d981
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,25 @@ public function showForm($ID, $options = []) {
echo '</div>';
}

// Validation status and comment
if ($this->fields['status'] == self::STATUS_REFUSED) {
echo '<div class="refused_header">';
echo '<div>' . nl2br($this->fields['comment']) . '</div>';
echo '</div>';
} else if ($this->fields['status'] == self::STATUS_ACCEPTED) {
echo '<div class="accepted_header">';
echo '<div>';
if (!empty($this->fields['comment'])) {
echo nl2br($this->fields['comment']);
} else if ($form->fields['validation_required']) {
echo __('Form accepted by validator.', 'formcreator');
} else {
echo __('Form successfully saved.', 'formcreator');
}
echo '</div>';
echo '</div>';
}

echo '<ol>';
$sections = (new PluginFormcreatorSection)->getSectionsFromForm($form->getID());
foreach ($sections as $section) {
Expand Down

0 comments on commit cc8d981

Please sign in to comment.