Skip to content
Snippets Groups Projects
Commit 03df3233 authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

Rework the layout of the email template edit page

parent dd9d30a2
No related branches found
No related tags found
No related merge requests found
...@@ -518,7 +518,8 @@ class EmailTemplate { ...@@ -518,7 +518,8 @@ class EmailTemplate {
$inst = self::lookup(self::create($vars, $errors)); $inst = self::lookup(self::create($vars, $errors));
// Inline images (attached to the draft) // Inline images (attached to the draft)
$inst->attachments->upload(Draft::getAttachmentIds($inst->getBody()), true); if ($inst)
$inst->attachments->upload(Draft::getAttachmentIds($inst->getBody()), true);
return $inst; return $inst;
} }
......
...@@ -34,12 +34,12 @@ if (is_a($template, EmailTemplateGroup)) { ...@@ -34,12 +34,12 @@ if (is_a($template, EmailTemplateGroup)) {
$tpl=$msgtemplates[$selected]; $tpl=$msgtemplates[$selected];
?> ?>
<h2>Email Template Message - <span><?php echo $name; ?></span></h2> <form method="get" action="templates.php?">
<div style="padding-top:10px;padding-bottom:5px;"> <h2><span>Email Template Set &nbsp;/&nbsp; <span><a href="templates.php?tpl_id=<?php echo $tpl_id; ?>"><?php echo $name; ?></a>
<form method="get" action="templates.php?">
<input type="hidden" name="a" value="manage"> <input type="hidden" name="a" value="manage">
<input type="hidden" name="tpl_id" value="<?php echo $tpl_id; ?>"> <input type="hidden" name="tpl_id" value="<?php echo $tpl_id; ?>">
Message Template: <div class="pull-right">
<span style="font-size:10pt">Viewing:</span>
<select id="tpl_options" name="id" style="width:300px;"> <select id="tpl_options" name="id" style="width:300px;">
<option value="">&mdash; Select Setting Group &mdash;</option> <option value="">&mdash; Select Setting Group &mdash;</option>
<?php <?php
...@@ -70,9 +70,10 @@ $tpl=$msgtemplates[$selected]; ...@@ -70,9 +70,10 @@ $tpl=$msgtemplates[$selected];
?> ?>
</select> </select>
<input type="submit" value="Go"> <input type="submit" value="Go">
&nbsp;&nbsp;&nbsp;<font color="red"><?php echo $errors['tpl']; ?></font> </div>
</form> </h2>
</div> </form>
<hr/>
<form action="templates.php?id=<?php echo $id; ?>&amp;a=manage" method="post" id="save"> <form action="templates.php?id=<?php echo $id; ?>&amp;a=manage" method="post" id="save">
<?php csrf_token(); ?> <?php csrf_token(); ?>
<?php foreach ($extras as $k=>$v) { ?> <?php foreach ($extras as $k=>$v) { ?>
...@@ -82,36 +83,30 @@ $tpl=$msgtemplates[$selected]; ...@@ -82,36 +83,30 @@ $tpl=$msgtemplates[$selected];
<input type="hidden" name="a" value="manage"> <input type="hidden" name="a" value="manage">
<input type="hidden" name="do" value="<?php echo $action; ?>"> <input type="hidden" name="do" value="<?php echo $action; ?>">
<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> <p>
<thead> <h3 style="font-size:12pt;"><?php echo $desc['name']; ?>
<tr> &nbsp;<i class="help-tip icon-question-sign"
<th colspan="2"> data-content="<?php echo Format::htmlchars($desc['desc']); ?>"
<h4><?php echo Format::htmlchars($desc['desc']); ?></h4> data-title="<?php echo Format::htmlchars($desc['name']); ?>"></i>
<em>Subject and body required. <a class="tip" href="#ticket_variables.txt">Supported Variables</a>.</em> <a style="font-size:10pt" class="tip pull-right" href="#ticket_variables.txt">Supported Variables</a>
</th> </h3>
</tr> <?php if ($errors) { ?>
</thead> <font class="error"><?php echo $errors['subject']; ?>&nbsp;<?php echo $errors['body']; ?></font>
<tbody> <?php } ?>
<tr> </p>
<td colspan=2>
<strong>Message Subject:</strong> <em>Email message subject</em> <font class="error">*&nbsp;<?php echo $errors['subject']; ?></font><br> <div>
<input type="text" name="subject" size="60" value="<?php echo $info['subject']; ?>" > <input type="text" name="subject" size="65" value="<?php echo $info['subject']; ?>"
</td> style="font-size:14pt">
</tr> <div style="margin-bottom:0.5em;margin-top:0.5em">
<tr> </div>
<td colspan="2"> <input type="hidden" name="draft_id" value=""/>
<div style="margin-bottom:0.5em;margin-top:0.5em"> <textarea name="body" cols="21" rows="16" style="width:98%;" wrap="soft"
<strong>Message Body:</strong> <em>Email message body.</em> <font class="error">*&nbsp;<?php echo $errors['body']; ?></font> class="richtext draft" data-draft-namespace="tpl.<?php echo $selected; ?>"
</div> data-draft-object-id="<?php echo $tpl_id; ?>"><?php echo $info['body']; ?></textarea>
<input type="hidden" name="draft_id" value=""/> </div>
<textarea name="body" cols="21" rows="16" style="width:98%;" wrap="soft"
class="richtext draft" data-draft-namespace="tpl.<?php echo $selected; ?>" <p style="text-align:center">
data-draft-object-id="<?php echo $tpl_id; ?>"><?php echo $info['body']; ?></textarea>
</td>
</tr>
</tbody>
</table>
<p style="padding-left:210px;">
<input class="button" type="submit" name="submit" value="Save Changes"> <input class="button" type="submit" name="submit" value="Save Changes">
<input class="button" type="reset" name="reset" value="Reset Changes" onclick="javascript: <input class="button" type="reset" name="reset" value="Reset Changes" onclick="javascript:
setTimeout('location.reload()', 25);" /> setTimeout('location.reload()', 25);" />
......
...@@ -111,8 +111,14 @@ jQuery(function() { ...@@ -111,8 +111,14 @@ jQuery(function() {
}); });
getHelpTips().then(function(tips) { getHelpTips().then(function(tips) {
var section = tips[elem.attr('href').substr(1)]; var href = elem.attr('href');
if (!section) { if (href) {
section = tips[elem.attr('href').substr(1)];
}
else if (elem.data('content')) {
section = {title: elem.data('title'), content: elem.data('content')};
}
else {
elem.remove(); elem.remove();
clearTimeout(tip_timer); clearTimeout(tip_timer);
return; return;
......
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