Skip to content

Commit d973396

Browse files
committed
Show print form only for single issue page
1 parent 8a07fe0 commit d973396

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/views/hooks/_print_issue_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% if @project.nil? or @project.module_enabled?(:gtt_print) %>
1+
<% if User.current.allowed_to?(:view_gtt_print, @project) and @issue.present? %>
22
<%= content_tag(:h3, l(:label_gtt_print_title)) %>
33
<form action="<%= Setting.plugin_redmine_gtt_print['default_print_server'] %>" method="post" class="print_box">
44
<select name="template">

assets/javascripts/gtt_print.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
$(function() {
2-
var server = ($('form.print_box').attr('action')).replace(/\/?$/, '/');
2+
if ($('form.print_box').length > 0) {
3+
var server = $('form.print_box').attr('action').replace(/\/?$/, '/');
34

4-
if (server) {
5-
$.getJSON(server + "print/apps.json", function (data) {
5+
$.getJSON("https://print.***REMOVED***/print/apps.json", function (data) {
66
$.each(data, function(key, value) {
77
// "default" profile does not really work for some reason
88
if (value != "default") {
@@ -23,4 +23,8 @@ $(function() {
2323

2424
return false;
2525
});
26+
27+
// var requestPrint = function () {
28+
29+
// };
2630
});

0 commit comments

Comments
 (0)