diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index e84b4b6a6d816bbe7d0683a92a4db449053ace36..1c9c44fb07063e747c102e9d18c86ed3f3bff63b 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -731,6 +731,9 @@ class DynamicFormEntry extends VerySimpleModel { } return $form; } + function getMedia() { + return $this->getForm()->getMedia(); + } function getFields() { if (!isset($this->_fields)) { diff --git a/include/class.forms.php b/include/class.forms.php index 5ac0738d6f417711bfac222007446d1b4e4c1372..01bd11ade51113b13ce482bd25d8e2a7fe128527 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -110,6 +110,7 @@ class Form { include(STAFFINC_DIR . 'templates/dynamic-form.tmpl.php'); else include(CLIENTINC_DIR . 'templates/dynamic-form.tmpl.php'); + echo $this->getMedia(); } function getMedia() { diff --git a/include/client/templates/dynamic-form.tmpl.php b/include/client/templates/dynamic-form.tmpl.php index 12b3944075e71ad3788be4be515fadb5478a56e8..9c36caaed5787557b8f2ee6a4bc52320126d416b 100644 --- a/include/client/templates/dynamic-form.tmpl.php +++ b/include/client/templates/dynamic-form.tmpl.php @@ -5,8 +5,6 @@ ?> <tr><td colspan="2"><hr /> <div class="form-header" style="margin-bottom:0.5em"> - <?php print ($form instanceof DynamicFormEntry) - ? $form->getForm()->getMedia() : $form->getMedia(); ?> <h3><?php echo Format::htmlchars($form->getTitle()); ?></h3> <em><?php echo Format::htmlchars($form->getInstructions()); ?></em> </div> diff --git a/include/client/view.inc.php b/include/client/view.inc.php index 509315ff46057e90ba7bb316b9a87f047ab62050..1821aea04ef1e06ca51f36faad023eb56916e49e 100644 --- a/include/client/view.inc.php +++ b/include/client/view.inc.php @@ -179,6 +179,7 @@ if (!$ticket->isClosed() || $ticket->isReopenable()) { ?> if ($messageField->isAttachmentsEnabled()) { ?> <?php print $attachments->render(true); + print $attachments->getForm()->getMedia(); ?> <?php } ?> diff --git a/include/staff/ticket-edit.inc.php b/include/staff/ticket-edit.inc.php index 2001e28505a525d15f0244f8d809c0e88d33bb8a..96d1abe6fc943457bf67cbfd3459582dd5b0da2c 100644 --- a/include/staff/ticket-edit.inc.php +++ b/include/staff/ticket-edit.inc.php @@ -134,7 +134,6 @@ if ($_POST) <?php if ($forms) foreach ($forms as $form) { $form->render(true, false, array('mode'=>'edit','width'=>160,'entry'=>$form)); - print $form->getForm()->getMedia(); } ?> </table> <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">