Skip to content
Snippets Groups Projects
Commit dfc8c63e authored by Peter Rotich's avatar Peter Rotich
Browse files

Field: Help Topic Forms

Don't show fields disabled by help topic
Pass create mode for pre-selected help topic forms
parent 8e4f621e
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,9 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) {
</tr>
</tbody>
<tbody id="dynamic-form">
<?php foreach ($forms as $form) {
<?php
$options = array('mode' => 'create');
foreach ($forms as $form) {
include(CLIENTINC_DIR . 'templates/dynamic-form.tmpl.php');
} ?>
</tbody>
......
......@@ -16,6 +16,14 @@ $isCreate = (isset($options['mode']) && $options['mode'] == 'create');
// Form fields, each with corresponding errors follows. Fields marked
// 'private' are not included in the output for clients
foreach ($form->getFields() as $field) {
try {
if (!$field->isEnabled())
continue;
}
catch (Exception $e) {
// Not connected to a DynamicFormField
}
if ($isCreate) {
if (!$field->isVisibleToUsers() && !$field->isRequiredForUsers())
continue;
......
......@@ -348,6 +348,7 @@ if ($_POST)
</tbody>
<tbody id="dynamic-form">
<?php
$options = array('mode' => 'create');
foreach ($forms as $form) {
print $form->getForm($_SESSION[':form-data'])->getMedia();
include(STAFFINC_DIR . 'templates/dynamic-form.tmpl.php');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment