Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
Include 2.6.X patches from alexwais#5
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Callegaro committed Feb 13, 2015
1 parent 49c2c40 commit 1e6d33e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
7 changes: 1 addition & 6 deletions lib/pdf.rb
Expand Up @@ -17,11 +17,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

require 'tcpdf'
require 'fpdf/chinese'
require 'fpdf/japanese'
require 'fpdf/korean'

if RUBY_VERSION < '1.9'
require 'iconv'
end
Expand All @@ -33,7 +28,7 @@ module PDF
include ActionView::Helpers::NumberHelper
include IssuesHelper

class ITCPDF < TCPDF
class ITCPDF < RBPDF
include Redmine::I18n
attr_accessor :footer_date

Expand Down
15 changes: 11 additions & 4 deletions lib/redmine_workflow_hidden_fields/workflows_helper_patch.rb
Expand Up @@ -11,13 +11,20 @@ def self.included(base)

module InstanceMethods

def field_permission_tag_with_hidden(permissions, status, field, role)
def field_permission_tag_with_hidden(permissions, status, field, roles)
name = field.is_a?(CustomField) ? field.id.to_s : field
options = [["", ""], [l(:label_readonly), "readonly"]]
options << [l(:label_hidden), "hidden"]
options << [l(:label_required), "required"] unless field_required?(field)
html_options = {}
selected = permissions[status.id][name]
if perm = permissions[status.id][name]
if perm.uniq.size > 1 || perm.size < @roles.size * @trackers.size
options << [l(:label_no_change_option), "no_change"]
selected = 'no_change'
else
selected = perm.first
end
end

hidden = field.is_a?(CustomField) && !field.visible? && !role.custom_fields.to_a.include?(field)
if hidden
Expand All @@ -26,9 +33,9 @@ def field_permission_tag_with_hidden(permissions, status, field, role)
html_options[:disabled] = true
end

select_tag("permissions[#{name}][#{status.id}]", options_for_select(options, selected), html_options)
select_tag("permissions[#{status.id}][#{name}]", options_for_select(options, selected), html_options)
end

end
end
end
end

0 comments on commit 1e6d33e

Please sign in to comment.