Skip to content
Snippets Groups Projects
Unverified Commit ef915213 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4601 from protich/issue/field-permissions++

Field: Help Topic Forms
parents 8e4f621e dfc8c63e
No related branches found
Tags v1.8.0
No related merge requests found
...@@ -89,7 +89,9 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) { ...@@ -89,7 +89,9 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) {
</tr> </tr>
</tbody> </tbody>
<tbody id="dynamic-form"> <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'); include(CLIENTINC_DIR . 'templates/dynamic-form.tmpl.php');
} ?> } ?>
</tbody> </tbody>
......
...@@ -16,6 +16,14 @@ $isCreate = (isset($options['mode']) && $options['mode'] == 'create'); ...@@ -16,6 +16,14 @@ $isCreate = (isset($options['mode']) && $options['mode'] == 'create');
// Form fields, each with corresponding errors follows. Fields marked // Form fields, each with corresponding errors follows. Fields marked
// 'private' are not included in the output for clients // 'private' are not included in the output for clients
foreach ($form->getFields() as $field) { foreach ($form->getFields() as $field) {
try {
if (!$field->isEnabled())
continue;
}
catch (Exception $e) {
// Not connected to a DynamicFormField
}
if ($isCreate) { if ($isCreate) {
if (!$field->isVisibleToUsers() && !$field->isRequiredForUsers()) if (!$field->isVisibleToUsers() && !$field->isRequiredForUsers())
continue; continue;
......
...@@ -348,6 +348,7 @@ if ($_POST) ...@@ -348,6 +348,7 @@ if ($_POST)
</tbody> </tbody>
<tbody id="dynamic-form"> <tbody id="dynamic-form">
<?php <?php
$options = array('mode' => 'create');
foreach ($forms as $form) { foreach ($forms as $form) {
print $form->getForm($_SESSION[':form-data'])->getMedia(); print $form->getForm($_SESSION[':form-data'])->getMedia();
include(STAFFINC_DIR . 'templates/dynamic-form.tmpl.php'); 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