Project

General

Profile

Feature #9432 » add_default_private_checkbox__with_redmine_track_control_plugin.patch

Barry Fisher, 2014-10-23 16:45

View differences:

app/models/project.rb
672 672
    'description',
673 673
    'homepage',
674 674
    'is_public',
675
    'private_issues_is_checked',
675 676
    'identifier',
676 677
    'custom_field_values',
677 678
    'custom_fields',
app/views/issues/_form.html.erb
3 3

  
4 4
<% if @issue.safe_attribute? 'is_private' %>
5 5
<p style="float:right; margin-right:1em;">
6
  <%= f.check_box :is_private, :no_label => true %><label class="inline" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
6
  <%= f.check_box :is_private, :checked => (@issue.new_record? && @issue.tracker.private_issues_is_checked?) || (!@issue.new_record? && @issue.is_private?), :no_label  => true %>
7 7
</p>
8 8
<% end %>
9 9

  
app/views/issues/new.html.erb
10 10
    <div id="all_attributes">
11 11
    <%= render :partial => 'issues/form', :locals => {:f => f} %>
12 12
    </div>
13

  
14 13
    <% if @copy_from && @copy_from.attachments.any? %>
15 14
    <p>
16 15
      <label for="copy_attachments"><%= l(:label_copy_attachments) %></label>
app/views/trackers/_form.html.erb
5 5
<!--[form:tracker]-->
6 6
<p><%= f.text_field :name, :required => true %></p>
7 7
<p><%= f.check_box :is_in_roadmap %></p>
8
<p><%= f.check_box :private_issues_is_checked %></p>
8 9

  
9 10
<p>
10 11
  <label><%= l(:field_core_fields) %></label>
config/locales/en.yml
321 321
  field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
322 322
  field_issues_visibility: Issues visibility
323 323
  field_is_private: Private
324
  field_private_issues_is_checked: Private issues by default
324 325
  field_commit_logs_encoding: Commit messages encoding
325 326
  field_scm_path_encoding: Path encoding
326 327
  field_path_to_repository: Path to repository
db/migrate/20140801_add_default_private_checkbox.rb
1
class AddDefaultPrivateCheckbox < ActiveRecord::Migration
2
  def self.up
3
    add_column :trackers, :private_issues_is_checked, :boolean, :default => false, :null => false
4
  end
5

  
6
  def self.down
7
    remove_column :trackers, :private_issues_is_checked
8
  end
9
end
plugins/redmine_track_control/app/views/issues/_form.html.erb
3 3

  
4 4
<% if @issue.safe_attribute? 'is_private' %>
5 5
<p style="float:right; margin-right:1em;">
6
  <%= f.check_box :is_private, :no_label => true %><label class="inline" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
6
  <%= f.check_box :is_private, :checked => (@issue.new_record? && @issue.tracker.private_issues_is_checked?) || (!@issue.new_record? && @issue.is_private?), :no_label  => true %>
7 7
</p>
8 8
<% end %>
9 9

  
(2-2/7)