Feature #1043 » redmine-my-calendar.patch
| /var/www/html/redmine/app/controllers/my_controller.rb 2008-04-11 15:04:34.000000000 -0400 | ||
|---|---|---|
|
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
|
||
|
end
|
||
|
def calendar
|
||
|
@user = User.current;
|
||
|
@trackers = Tracker.find(:all, :order => 'position')
|
||
|
retrieve_selected_tracker_ids(@trackers)
|
||
|
|
||
|
if params[:year] and params[:year].to_i > 1900
|
||
|
@year = params[:year].to_i
|
||
|
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
|
||
|
@month = params[:month].to_i
|
||
|
end
|
||
|
end
|
||
|
@year ||= Date.today.year
|
||
|
@month ||= Date.today.month
|
||
|
@calendar = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1),
|
||
|
current_language, :month)
|
||
|
|
||
|
@calendar.events = Issue.find(:all,
|
||
|
:include => [:project, :tracker, :priority, :assigned_to],
|
||
|
:conditions => ["#{Issue.table_name}.assigned_to_id=? AND ((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)) AND #{Issue.table_name}.tracker_id IN (#{@selected_tracker_ids.join(',')})", @user.id, @calendar.startdt, @calendar.enddt, @calendar.startdt, @calendar.enddt]) unless @user.projects.empty?
|
||
|
logger.debug "Date: #{@month} (#{month_name(@month).downcase}) #{@year}"
|
||
|
render :layout => false if request.xhr?
|
||
|
end
|
||
|
# Edit user's account
|
||
|
def account
|
||
|
@user = User.current
|
||
| ... | ... | |
|
session[:page_layout] = nil
|
||
|
redirect_to :action => 'page'
|
||
|
end
|
||
|
private
|
||
|
def retrieve_selected_tracker_ids(selectable_trackers)
|
||
|
if ids = params[:tracker_ids]
|
||
|
@selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }
|
||
|
else
|
||
|
@selected_tracker_ids = selectable_trackers.collect {|t| t.id.to_s }
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
-- redmine-0.6.4/app/views/layouts/base.rhtml 2008-03-12 14:10:48.000000000 -0400
|
||
|
++ /var/www/html/redmine/app/views/layouts/base.rhtml 2008-04-11 15:05:40.000000000 -0400
|
||
| ... | ... | |
|
</div>
|
||
|
<%= link_to l(:label_home), home_url, :class => 'home' %>
|
||
|
<%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => 'mypage' if User.current.logged? %>
|
||
|
<%= link_to l(:label_my_calendar), { :controller => 'my', :action => 'calendar'}, :class => 'mypage' if User.current.logged? %>
|
||
|
<%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => 'projects' %>
|
||
|
<%= link_to l(:label_administration), { :controller => 'admin' }, :class => 'admin' if User.current.admin? %>
|
||
|
<%= link_to l(:label_help), Redmine::Info.help_url, :class => 'help' %>
|
||
| /var/www/html/redmine/lang/en.yml 2008-04-11 15:05:52.000000000 -0400 | ||
|---|---|---|
|
label_password_lost: Lost password
|
||
|
label_home: Home
|
||
|
label_my_page: My page
|
||
|
label_my_calendar: My Calendar
|
||
|
label_my_account: My account
|
||
|
label_my_projects: My projects
|
||
|
label_administration: Administration
|
||