32 |
32 |
"<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
|
33 |
33 |
"<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}"
|
34 |
34 |
end
|
|
35 |
|
|
36 |
def sidebar_queries_custom(visible)
|
|
37 |
# Project specific queries and global queries
|
|
38 |
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
|
|
39 |
@sidebar_queries_custom = Query.find(:all,
|
|
40 |
:order => "name ASC",
|
|
41 |
:conditions => visible.conditions)
|
|
42 |
@sidebar_queries_custom
|
|
43 |
end
|
35 |
44 |
|
36 |
45 |
def sidebar_queries
|
37 |
46 |
unless @sidebar_queries
|
38 |
47 |
# User can see public queries and his own queries
|
39 |
48 |
visible = ARCondition.new(["is_public = ? OR user_id = ?", true, (User.current.logged? ? User.current.id : 0)])
|
40 |
|
# Project specific queries and global queries
|
41 |
|
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
|
42 |
|
@sidebar_queries = Query.find(:all,
|
43 |
|
:order => "name ASC",
|
44 |
|
:conditions => visible.conditions)
|
|
49 |
@sidebar_queries = sidebar_queries_custom(visible)
|
45 |
50 |
end
|
46 |
51 |
@sidebar_queries
|
47 |
52 |
end
|
48 |
53 |
|
|
54 |
def sidebar_queries_public
|
|
55 |
unless @sidebar_queries_public
|
|
56 |
# User can see public queries
|
|
57 |
visible = ARCondition.new(["is_public = ?", true])
|
|
58 |
@sidebar_queries_public = sidebar_queries_custom(visible)
|
|
59 |
end
|
|
60 |
@sidebar_queries_public
|
|
61 |
end
|
|
62 |
|
|
63 |
def sidebar_queries_private
|
|
64 |
unless @sidebar_queries_private
|
|
65 |
# User can see private queries
|
|
66 |
visible = ARCondition.new(["is_public = ? AND user_id = ?", false, (User.current.logged? ? User.current.id : 0)])
|
|
67 |
@sidebar_queries_private = sidebar_queries_custom(visible)
|
|
68 |
end
|
|
69 |
@sidebar_queries_private
|
|
70 |
end
|
|
71 |
|
49 |
72 |
def show_detail(detail, no_html=false)
|
50 |
73 |
case detail.property
|
51 |
74 |
when 'attr'
|