diff --git a/app/models/project.rb b/app/models/project.rb index fd9d647..6e0540f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -672,6 +672,7 @@ class Project < ActiveRecord::Base 'description', 'homepage', 'is_public', + 'private_issues_is_checked', 'identifier', 'custom_field_values', 'custom_fields', diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 401789c..fa001d3 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -3,7 +3,7 @@ <% if @issue.safe_attribute? 'is_private' %>

- <%= f.check_box :is_private, :no_label => true %> + <%= f.check_box :is_private, :checked => (@issue.new_record? && @issue.tracker.private_issues_is_checked?) || (!@issue.new_record? && @issue.is_private?), :no_label => true %>

<% end %> diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index 40dae18..f465d4c 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -10,7 +10,6 @@
<%= render :partial => 'issues/form', :locals => {:f => f} %>
- <% if @copy_from && @copy_from.attachments.any? %>

diff --git a/app/views/trackers/_form.html.erb b/app/views/trackers/_form.html.erb index 4c73555..645e540 100644 --- a/app/views/trackers/_form.html.erb +++ b/app/views/trackers/_form.html.erb @@ -5,6 +5,7 @@

<%= f.text_field :name, :required => true %>

<%= f.check_box :is_in_roadmap %>

+

<%= f.check_box :private_issues_is_checked %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 58ce86c..fe3407a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -321,6 +321,7 @@ en: field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text" field_issues_visibility: Issues visibility field_is_private: Private + field_private_issues_is_checked: Private issues by default field_commit_logs_encoding: Commit messages encoding field_scm_path_encoding: Path encoding field_path_to_repository: Path to repository diff --git a/db/migrate/20140801_add_default_private_checkbox.rb b/db/migrate/20140801_add_default_private_checkbox.rb new file mode 100644 index 0000000..522386b --- /dev/null +++ b/db/migrate/20140801_add_default_private_checkbox.rb @@ -0,0 +1,9 @@ +class AddDefaultPrivateCheckbox < ActiveRecord::Migration + def self.up + add_column :trackers, :private_issues_is_checked, :boolean, :default => false, :null => false + end + + def self.down + remove_column :trackers, :private_issues_is_checked + end +end diff --git a/plugins/redmine_track_control/app/views/issues/_form.html.erb b/plugins/redmine_track_control/app/views/issues/_form.html.erb index 07b3fcb..3f12a78 100644 --- a/plugins/redmine_track_control/app/views/issues/_form.html.erb +++ b/plugins/redmine_track_control/app/views/issues/_form.html.erb @@ -3,7 +3,7 @@ <% if @issue.safe_attribute? 'is_private' %>

- <%= f.check_box :is_private, :no_label => true %> + <%= f.check_box :is_private, :checked => (@issue.new_record? && @issue.tracker.private_issues_is_checked?) || (!@issue.new_record? && @issue.is_private?), :no_label => true %>

<% end %>