diff --git a/include/client/open.inc.php b/include/client/open.inc.php index 021de566acdb8dda91ff475a13b942e161cd650e..d0a96effc9dbfa94f840ea6ec5e14de4a7c7d881 100644 --- a/include/client/open.inc.php +++ b/include/client/open.inc.php @@ -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> diff --git a/include/client/templates/dynamic-form.tmpl.php b/include/client/templates/dynamic-form.tmpl.php index e7e017a5999e4b84705ecf0c59de4a4a8a195045..f668f4320daf5e690a3095aed43aae96bcfb486e 100644 --- a/include/client/templates/dynamic-form.tmpl.php +++ b/include/client/templates/dynamic-form.tmpl.php @@ -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; diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php index 09bcfb21fdf95ee2a05366724b6ee921c63eaf48..267d927651833ba064e7bf38b1978b100433c752 100644 --- a/include/staff/ticket-open.inc.php +++ b/include/staff/ticket-open.inc.php @@ -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');