Skip to content

Commit 0575224

Browse files
committed
Retreive print configurations
1 parent bb68fe1 commit 0575224

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

app/views/hooks/_print_issue_form.html.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
<% if @project.nil? or @project.module_enabled?(:gtt_print) %>
22
<%= content_tag(:h3, l(:label_gtt_print_title)) %>
3-
<form action="#" method="post" class="print_box">
3+
<form action="<%= Setting.plugin_redmine_gtt_print['default_print_server'] %>" method="post" class="print_box">
44
<select name="template">
5-
<option value="1">TPL-FORM-000001</option>
6-
<option value="2">TPL-FORM-000002</option>
7-
<option value="3">TPL-FORM-000003</option>
8-
<option value="4">TPL-FORM-000004</option>
9-
<option value="5">TPL-FORM-000005</option>
10-
<option value="6">TPL-FORM-000006</option>
115
</select>
126
<%= content_tag(:input, nil, type: "button", value: l(:button_gtt_print_submit)) %>
137
</form>

assets/javascripts/gtt_print.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
$(document).on('click', '.print_box input[type=button]', function(e){
2-
console.log('TODO: submit print');
3-
return false;
1+
$(function() {
2+
var server = ($('form.print_box').attr('action')).replace(/\/?$/, '/');
3+
4+
if (server) {
5+
$.getJSON(server + "print/apps.json", function (data) {
6+
$.each(data, function(key, value) {
7+
var option = $("<option></option>").attr("value",value).text(value);
8+
$('form.print_box select').append(option);
9+
});
10+
});
11+
}
12+
13+
$(document).on('click', '.print_box input[type=button]', function(e){
14+
console.log('TODO: submit print');
15+
return false;
16+
});
417
});

0 commit comments

Comments
 (0)