@@ -1,75 +1,75 | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | # |
|
3 | 3 | # Redmine - project management software |
|
4 | 4 | # Copyright (C) 2006-2016 Jean-Philippe Lang |
|
5 | 5 | # |
|
6 | 6 | # This program is free software; you can redistribute it and/or |
|
7 | 7 | # modify it under the terms of the GNU General Public License |
|
8 | 8 | # as published by the Free Software Foundation; either version 2 |
|
9 | 9 | # of the License, or (at your option) any later version. |
|
10 | 10 | # |
|
11 | 11 | # This program is distributed in the hope that it will be useful, |
|
12 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | 14 | # GNU General Public License for more details. |
|
15 | 15 | # |
|
16 | 16 | # You should have received a copy of the GNU General Public License |
|
17 | 17 | # along with this program; if not, write to the Free Software |
|
18 | 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
19 | 19 | |
|
20 | 20 | module MyHelper |
|
21 | 21 | def calendar_items(startdt, enddt) |
|
22 | 22 | Issue.visible. |
|
23 | 23 | where(:project_id => User.current.projects.map(&:id)). |
|
24 | 24 | where("(start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)", startdt, enddt, startdt, enddt). |
|
25 | 25 | includes(:project, :tracker, :priority, :assigned_to). |
|
26 | 26 | references(:project, :tracker, :priority, :assigned_to). |
|
27 | 27 | to_a |
|
28 | 28 | end |
|
29 | 29 | |
|
30 | 30 | def documents_items |
|
31 | 31 | Document.visible.order("#{Document.table_name}.created_on DESC").limit(10).to_a |
|
32 | 32 | end |
|
33 | 33 | |
|
34 | 34 | def issuesassignedtome_items |
|
35 | 35 | Issue.visible.open. |
|
36 | 36 | assigned_to(User.current). |
|
37 | 37 | limit(10). |
|
38 | 38 | includes(:status, :project, :tracker, :priority). |
|
39 | 39 | references(:status, :project, :tracker, :priority). |
|
40 | 40 | order("#{IssuePriority.table_name}.position DESC, #{Issue.table_name}.updated_on DESC") |
|
41 | 41 | end |
|
42 | 42 | |
|
43 | 43 | def issuesreportedbyme_items |
|
44 | Issue.visible. | |
|
44 | Issue.visible.open. | |
|
45 | 45 | where(:author_id => User.current.id). |
|
46 | 46 | limit(10). |
|
47 | 47 | includes(:status, :project, :tracker). |
|
48 | 48 | references(:status, :project, :tracker). |
|
49 | 49 | order("#{Issue.table_name}.updated_on DESC") |
|
50 | 50 | end |
|
51 | 51 | |
|
52 | 52 | def issueswatched_items |
|
53 | 53 | Issue.visible.open.on_active_project.watched_by(User.current.id).recently_updated.limit(10) |
|
54 | 54 | end |
|
55 | 55 | |
|
56 | 56 | def news_items |
|
57 | 57 | News.visible. |
|
58 | 58 | where(:project_id => User.current.projects.map(&:id)). |
|
59 | 59 | limit(10). |
|
60 | 60 | includes(:project, :author). |
|
61 | 61 | references(:project, :author). |
|
62 | 62 | order("#{News.table_name}.created_on DESC"). |
|
63 | 63 | to_a |
|
64 | 64 | end |
|
65 | 65 | |
|
66 | 66 | def timelog_items |
|
67 | 67 | TimeEntry. |
|
68 | 68 | where("#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", User.current.id, User.current.today - 6, User.current.today). |
|
69 | 69 | joins(:activity, :project). |
|
70 | 70 | references(:issue => [:tracker, :status]). |
|
71 | 71 | includes(:issue => [:tracker, :status]). |
|
72 | 72 | order("#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC"). |
|
73 | 73 | to_a |
|
74 | 74 | end |
|
75 | 75 | end |
@@ -1,15 +1,15 | |||
|
1 | 1 | <% reported_issues = issuesreportedbyme_items %> |
|
2 | 2 | <h3> |
|
3 | 3 | <%= link_to l(:label_reported_issues), |
|
4 |
issues_path(:set_filter => 1, :status_id => ' |
|
|
4 | issues_path(:set_filter => 1, :status_id => 'o', :author_id => 'me', :sort => 'updated_on:desc') %> | |
|
5 | 5 | (<%= reported_issues.limit(nil).count %>) |
|
6 | 6 | </h3> |
|
7 | 7 | |
|
8 | 8 | <%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues.to_a } %> |
|
9 | 9 | |
|
10 | 10 | <% content_for :header_tags do %> |
|
11 | 11 | <%= auto_discovery_link_tag(:atom, |
|
12 | 12 | {:controller => 'issues', :action => 'index', :set_filter => 1, |
|
13 | 13 | :author_id => 'me', :format => 'atom', :key => User.current.rss_key}, |
|
14 | 14 | {:title => l(:label_reported_issues)}) %> |
|
15 | 15 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now