Revision 1298:4f746d8966dd app/views/my/blocks

View differences:

app/views/my/blocks/_calendar.html.erb
1 1
<h3><%= l(:label_calendar) %></h3>
2 2

  
3 3
<% calendar = Redmine::Helpers::Calendar.new(Date.today, current_language, :week)
4
   calendar.events = Issue.visible.find :all,
5
                     :conditions => ["#{Issue.table_name}.project_id in (#{@user.projects.collect{|m| m.id}.join(',')}) AND ((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", calendar.startdt, calendar.enddt, calendar.startdt, calendar.enddt],
6
                     :include => [:project, :tracker, :priority, :assigned_to] unless @user.projects.empty? %>
4
   calendar.events = calendar_items(calendar.startdt, calendar.enddt) %>
7 5

  
8 6
<%= render :partial => 'common/calendar', :locals => {:calendar => calendar } %>
app/views/my/blocks/_documents.html.erb
1 1
<h3><%=l(:label_document_plural)%></h3>
2 2

  
3
<% project_ids = @user.projects.select {|p| @user.allowed_to?(:view_documents, p)}.collect(&:id) %>
4
<%= render(:partial => 'documents/document',
5
           :collection => Document.find(:all,
6
                         :limit => 10,
7
                         :order => "#{Document.table_name}.created_on DESC",
8
                         :conditions => "#{Document.table_name}.project_id in (#{project_ids.join(',')})",
9
                         :include => [:project])) unless project_ids.empty? %>
3
<%= render :partial => 'documents/document', :collection => documents_items %>
app/views/my/blocks/_issuesassignedtome.html.erb
1 1
<h3><%=l(:label_assigned_to_me_issues)%> (<%= Issue.visible.open.count(:conditions => {:assigned_to_id => ([User.current.id] + User.current.group_ids)})%>)</h3>
2 2

  
3
<% assigned_issues = Issue.visible.open.find(:all,
4
                                :conditions => {:assigned_to_id => ([User.current.id] + User.current.group_ids)},
5
                                :limit => 10,
6
                                :include => [ :status, :project, :tracker, :priority ],
7
                                :order => "#{IssuePriority.table_name}.position DESC, #{Issue.table_name}.updated_on DESC") %>
3
<% assigned_issues = issuesassignedtome_items %>
8 4
<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
9 5
<% if assigned_issues.length > 0 %>
10 6
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
app/views/my/blocks/_issuesreportedbyme.html.erb
1 1
<h3><%=l(:label_reported_issues)%> (<%= Issue.visible.count(:conditions => { :author_id => User.current.id }) %>)</h3>
2 2

  
3
<% reported_issues = Issue.visible.find(:all,
4
                                :conditions => { :author_id => User.current.id },
5
                                :limit => 10,
6
                                :include => [ :status, :project, :tracker ],
7
                                :order => "#{Issue.table_name}.updated_on DESC") %>
3
<% reported_issues = issuesreportedbyme_items %>
8 4
<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>
9 5
<% if reported_issues.length > 0 %>
10 6
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
app/views/my/blocks/_issueswatched.html.erb
1 1
<h3><%=l(:label_watched_issues)%> (<%= Issue.visible.watched_by(user.id).count %>)</h3>
2
<% watched_issues = Issue.visible.on_active_project.watched_by(user.id).recently_updated.limit(10) %>
2
<% watched_issues = issueswatched_items %>
3 3

  
4 4
<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues } %>
5 5
<% if watched_issues.length > 0 %>
app/views/my/blocks/_news.html.erb
1 1
<h3><%=l(:label_news_latest)%></h3>
2 2

  
3
<%= render(:partial => 'news/news',
4
            :collection => News.find(:all,
5
                                     :limit => 10,
6
                                     :order => "#{News.table_name}.created_on DESC",
7
                                     :conditions => "#{News.table_name}.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
8
                                     :include => [:project, :author])) unless @user.projects.empty? %>
3
<%= render :partial => 'news/news', :collection => news_items %>
app/views/my/blocks/_timelog.html.erb
1 1
<h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
2 2
<%
3
entries = TimeEntry.find(:all,
4
        :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today],
5
        :include => [:activity, :project, {:issue => [:tracker, :status]}],
6
        :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC")
3
entries = timelog_items
7 4
entries_by_day = entries.group_by(&:spent_on)
8 5
%>
9 6

  
10 7
<div class="total-hours">
11
<p><%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
8
<p><%= l(:label_total_time) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
12 9
</div>
13 10

  
14 11
<% if entries.any? %>

Also available in: Unified diff