Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/models/issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class Issue < ActiveRecord::Base
before_create :default_assign
before_save :close_duplicates, :update_done_ratio_from_issue_status
after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
before_destroy :remove_from_parent
after_destroy :update_parent_attributes

# Returns a SQL conditions string used to find all issues visible by the specified user
Expand Down Expand Up @@ -280,7 +281,7 @@ def estimated_hours=(h)
safe_attributes 'is_private',
:if => lambda {|issue, user|
user.allowed_to?(:set_issues_private, issue.project) ||
(issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
((issue.author == user || issue.author == nil) && user.allowed_to?(:set_own_issues_private, issue.project))
}

# Safely sets attributes
Expand Down Expand Up @@ -790,6 +791,11 @@ def update_nested_set_attributes
remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
end

def remove_from_parent
self.parent_issue_id = nil
update_nested_set_attributes
end

def update_parent_attributes
recalculate_attributes_for(parent_id) if parent_id
end
Expand Down
6 changes: 4 additions & 2 deletions app/views/projects/show.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
<h3><%=l(:label_issue_tracking)%></h3>
<ul>
<% for tracker in @trackers %>
<li><%= link_to h(tracker.name), :controller => 'issues', :action => 'index', :project_id => @project,
<% if @total_issues_by_tracker[tracker].to_i > 0 %>
<li><%= link_to h(tracker.name), :controller => 'issues', :action => 'index', :project_id => @project,
:set_filter => 1,
"tracker_id" => tracker.id %>:
<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
:total => @total_issues_by_tracker[tracker].to_i) %>
</li>
</li>
<% end %>
<% end %>
</ul>
<p>
Expand Down