Fixed edit-javascript

This commit is contained in:
f0o
2015-08-30 18:05:57 +01:00
parent a833d46d4d
commit bea0587634
2 changed files with 6 additions and 2 deletions

View File

@@ -21,8 +21,10 @@ $template_id = ($_POST['template_id']);
if (is_numeric($template_id) && $template_id > 0) { if (is_numeric($template_id) && $template_id > 0) {
$template = dbFetchRow('SELECT * FROM `alert_templates` WHERE `id` = ? LIMIT 1', array($template_id)); $template = dbFetchRow('SELECT * FROM `alert_templates` WHERE `id` = ? LIMIT 1', array($template_id));
$output = array( $output = array(
'template' => $template['template'], 'template' => $template['template'],
'name' => $template['name'], 'name' => $template['name'],
'title' => $template['title'],
'title_rec' => $template['title_rec'],
); );
echo _json_encode($output); echo _json_encode($output);
} }

View File

@@ -115,6 +115,8 @@ $('#alert-template').on('show.bs.modal', function (event) {
success: function(output) { success: function(output) {
$('#template').val(output['template']); $('#template').val(output['template']);
$('#name').val(output['name']); $('#name').val(output['name']);
$('#title').val(output['title']);
$('#title_rec').val(output['title_rec']);
} }
}); });
} }