Skip to content

Commit 38f3094

Browse files
committed
fix(form): purge message if answers exist
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent f9204ef commit 38f3094

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

inc/form.class.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,22 @@ public function showForm($ID, $options = []) {
570570
echo '</td>';
571571
echo '</tr>';
572572

573+
echo '<tr>';
573574
echo '<td>'.__('Default form in service catalog', 'formcreator').'</td>';
574575
echo '<td>';
575576
Dropdown::showYesNo("is_default", $this->fields["is_default"]);
576577
echo '</td>';
577578
echo '</tr>';
578579

580+
if (!$this->canPurgeItem()) {
581+
echo '<tr>';
582+
echo '<td colspan="4">'
583+
. '<i class="fas fa-exclamation-triangle"></i>&nbsp;'
584+
. __('To delete this form you must delete all its answers first.', 'formcreator')
585+
. '</td>';
586+
echo '</tr>';
587+
}
588+
579589
$this->showFormButtons($options);
580590
}
581591

0 commit comments

Comments
 (0)