Project

General

Profile

Patch #6688 ยป query_enhancements_in_calendar_and_gantt-r4249.diff

Patch against trunk at r4249 - Mischa The Evil, 2010-10-18 06:27

View differences:

app/views/projects/index.rhtml (working copy)
6 6
    <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
7 7
    <%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
8 8
    <%= link_to(l(:label_overall_spent_time), { :controller => 'time_entries' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
9
    <%= link_to(l(:label_calendar), { :controller => 'calendars', :action => 'show' }) + ' |' if User.current.allowed_to?(:view_calendar, nil, :global => true) %>
10
    <%= link_to(l(:label_gantt), { :controller => 'gantts', :action => 'show' }) + ' |' if User.current.allowed_to?(:view_gantt, nil, :global => true) %>
9 11
    <%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
10 12
</div>
11 13

  
app/views/calendars/show.html.erb (working copy)
1
<h2><%= l(:label_calendar) %></h2>
1
<h2><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2>
2
<% html_title(@query.new_record? ? l(:label_calendar) : @query.name) %>
2 3

  
3 4
<% form_tag(calendar_path, :method => :put, :id => 'query_form') do %>
4 5
  <%= hidden_field_tag('project_id', @project.to_param) if @project%>
......
26 27
                   }, :class => 'icon icon-checked' %>
27 28
                   
28 29
<%= link_to_remote l(:button_clear),
29
                   { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) }, 
30
                     :method => :put,
30
                   { :url => { :project_id => @project, :set_filter => 1 }, 
31
                     :method => :get,
31 32
                     :update => "content",
32
                   }, :class => 'icon icon-reload' if @query.new_record? %>
33
                   }, :class => 'icon icon-reload' %>
33 34
</p>
34 35
<% end %>
35 36

  
......
47 48
<% content_for :sidebar do %>
48 49
    <%= render :partial => 'issues/sidebar' %>
49 50
<% end %>
50

  
51
<% html_title(l(:label_calendar)) -%>
app/views/gantts/show.html.erb (working copy)
1 1
<% @gantt.view = self %>
2
<h2><%= l(:label_gantt) %></h2>
2
<h2><%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
3
<% html_title(@query.new_record? ? l(:label_gantt) : @query.name) %>
3 4

  
4 5
<% form_tag(gantt_path(:month => params[:month], :year => params[:year], :months => params[:months]), :method => :put, :id => 'query_form') do %>
5 6
  <%= hidden_field_tag('project_id', @project.to_param) if @project%>
......
29 30
                   }, :class => 'icon icon-checked' %>
30 31
                   
31 32
<%= link_to_remote l(:button_clear),
32
                   { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) }, 
33
                   	 :method => :put,
33
                   { :url => { :project_id => @project, :set_filter => 1 }, 
34
                   	 :method => :get,
34 35
                     :update => "content",
35
                   }, :class => 'icon icon-reload' if @query.new_record? %>
36
                   }, :class => 'icon icon-reload' %>
36 37
</p>
37 38
<% end %>
38 39

  
......
184 185
<% content_for :sidebar do %>
185 186
    <%= render :partial => 'issues/sidebar' %>
186 187
<% end %>
187

  
188
<% html_title(l(:label_gantt)) -%>
app/views/issues/_sidebar.rhtml (working copy)
5 5
<% end %>
6 6
<%= call_hook(:view_issues_sidebar_issues_bottom) %>
7 7

  
8
<% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
9
	<%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %><br />
10
<% end %>
11
<% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
12
	<%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %><br />
13
<% end %>
14
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
15

  
16 8
<% unless sidebar_queries.empty? -%>
17 9
<h3><%= l(:label_query_plural) %></h3>
18 10

  
19 11
<% sidebar_queries.each do |query| -%>
20
<%= link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) %><br />
12
<%= link_to(h(query.name), :controller => controller_name, :action => (controller_name == 'issues' ? 'index' : 'show'), :project_id => @project, :query_id => query) %><br />
13

  
21 14
<% end -%>
22 15
<%= call_hook(:view_issues_sidebar_queries_bottom) %>
23 16
<% end -%>
    (1-1/1)