From 5a471d8732d1b723530cabd4342a937cef5ce565 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Tue, 5 Aug 2014 07:24:03 -0500 Subject: [PATCH] Implement client l10n of new ticket forms --- assets/default/css/theme.css | 2 +- include/class.forms.php | 5 +--- include/class.topic.php | 2 ++ .../client/templates/dynamic-form.tmpl.php | 24 +++++++++---------- include/staff/templates/dynamic-form.tmpl.php | 3 +++ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/assets/default/css/theme.css b/assets/default/css/theme.css index e50724e19..156d65da1 100644 --- a/assets/default/css/theme.css +++ b/assets/default/css/theme.css @@ -544,7 +544,7 @@ body { #clientLogin div label { display: block; } -label.required { +label.required, span.required { font-weight: bold; } #ticketForm div label.required, diff --git a/include/class.forms.php b/include/class.forms.php index 1d7f95031..77248c828 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -2045,10 +2045,7 @@ class ThreadEntryWidget extends Widget { $object_id = substr(session_id(), -12); } list($draft, $attrs) = Draft::getDraftAndDataAttrs($namespace, $object_id, $this->value); - ?><div style="margin-bottom:0.5em;margin-top:0.5em"><strong><?php - echo Format::htmlchars($this->field->get('label')); - ?></strong>:</div> - + ?> <textarea style="width:100%;" name="<?php echo $this->field->get('name'); ?>" placeholder="<?php echo Format::htmlchars($this->field->get('hint')); ?>" class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; diff --git a/include/class.topic.php b/include/class.topic.php index 395e482ad..e628919c0 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -436,6 +436,8 @@ class Topic { } static function updateSortOrder() { + global $cfg; + // Fetch (un)sorted names if (!($names = static::getHelpTopics(false, true, false))) return; diff --git a/include/client/templates/dynamic-form.tmpl.php b/include/client/templates/dynamic-form.tmpl.php index 12b394407..fff9aa3a7 100644 --- a/include/client/templates/dynamic-form.tmpl.php +++ b/include/client/templates/dynamic-form.tmpl.php @@ -20,26 +20,24 @@ continue; ?> <tr> - <?php if ($field->isBlockLevel()) { ?> - <td colspan="2"> - <?php - } - else { ?> - <td><label for="<?php echo $field->getFormName(); ?>" class="<?php + <td colspan="2" style="padding-top:8px;"> + <label for="<?php echo $field->getFormName(); ?>"><span class="<?php if ($field->get('required')) echo 'required'; ?>"> - <?php echo Format::htmlchars($field->get('label')); ?>:</label></td><td> - <?php - } - $field->render('client'); ?> + <?php echo Format::htmlchars($field->getLocal('label')); ?> <?php if ($field->get('required')) { ?> - <font class="error">*</font> + <span class="error">*</span> <?php } + ?></span><?php if ($field->get('hint') && !$field->isBlockLevel()) { ?> <br /><em style="color:gray;display:inline-block"><?php - echo Format::htmlchars($field->get('hint')); ?></em> + echo Format::htmlchars($field->getLocal('hint')); ?></em> <?php - } + } ?> + <br/> + <?php + $field->render('client'); + ?></label><?php foreach ($field->errors() as $e) { ?> <br /> <font class="error"><?php echo $e; ?></font> diff --git a/include/staff/templates/dynamic-form.tmpl.php b/include/staff/templates/dynamic-form.tmpl.php index 6d0e15121..2066056d4 100644 --- a/include/staff/templates/dynamic-form.tmpl.php +++ b/include/staff/templates/dynamic-form.tmpl.php @@ -47,6 +47,9 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?> ?> <tr><?php if ($field->isBlockLevel()) { ?> <td colspan="2"> + <div style="margin-bottom:0.5em;margin-top:0.5em"><strong><?php + echo Format::htmlchars($field->getLocal('label')); + ?></strong>:</div> <?php } else { ?> -- GitLab