<%= l(:label_calendar) %>

<% form_tag() do %> <%= check_box_tag('cal_hide_not_assigned_to_me', 1, params[:cal_hide_not_assigned_to_me]) %>hide issues not assigned to me <%= check_box_tag('cal_hide_closed', @user.id, params[:cal_hide_closed]) %>hide closed issues <%= submit_tag l(:button_apply), :class => 'button-small' %> <% end %> <% @date_from = Date.today - (Date.today.cwday-1) @date_to = Date.today + (7-Date.today.cwday) hide_not_assigned_to_me = params[:cal_hide_not_assigned_to_me] == nil ? 0 : 1 hide_closed = params[:cal_hide_closed] == nil ? 0 : 1 @issues = Issue.find :all, :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<=?)) AND (? = 0 or assigned_to_id = ?) AND (? = 0 or #{IssueStatus.table_name}.is_closed = ?)", @date_from, @date_to, @date_from, @date_to, hide_not_assigned_to_me, @user.id, hide_closed, false], :include => [:project, :tracker, :status] unless @user.projects.empty? @issues ||= [] %> <% 1.upto(7) do |d| %> <% end %> <% day = @date_from while day <= @date_to if day.cwday == 1 %> <% end %> <%= '' if day.cwday >= 7 and day!=@date_to %> <% day = day + 1 end %>
<%= day_name(d) %>
<%= day.cweek %>">

<%= day==Date.today ? "#{day.day}" : day.day %>

<% day_issues = [] @issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day } day_issues.each do |i| %> <%= if day == i.start_date and day == i.due_date image_tag('arrow_bw.png') elsif day == i.start_date image_tag('arrow_from.png') elsif day == i.due_date image_tag('arrow_to.png') end %> <%= link_to_issue i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %>
<% end %>