summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/my_helper.rb11
-rw-r--r--config/locales/en.yml1
-rw-r--r--lib/redmine/my_page.rb1
-rw-r--r--test/functional/my_controller_test.rb28
4 files changed, 40 insertions, 1 deletions
diff --git a/app/helpers/my_helper.rb b/app/helpers/my_helper.rb
index 67a57faaa..ca96dd72c 100644
--- a/app/helpers/my_helper.rb
+++ b/app/helpers/my_helper.rb
@@ -115,6 +115,17 @@ module MyHelper
render :partial => 'my/blocks/issues', :locals => {:query => query, :issues => issues, :block => block}
end
+ def render_issuesupdatedbyme_block(block, settings)
+ query = IssueQuery.new(:name => l(:label_updated_issues), :user => User.current)
+ query.add_filter 'updated_by', '=', ['me']
+ query.add_filter 'project.status', '=', ["#{Project::STATUS_ACTIVE}"]
+ query.column_names = settings[:columns].presence || ['project', 'tracker', 'status', 'subject']
+ query.sort_criteria = settings[:sort].presence || [['updated_on', 'desc']]
+ issues = query.issues(:limit => 10)
+
+ render :partial => 'my/blocks/issues', :locals => {:query => query, :issues => issues, :block => block}
+ end
+
def render_issueswatched_block(block, settings)
query = IssueQuery.new(:name => l(:label_watched_issues), :user => User.current)
query.add_filter 'watcher_id', '=', ['me']
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 4eda0a81c..087e74939 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -626,6 +626,7 @@ en:
label_reported_issues: Reported issues
label_assigned_issues: Assigned issues
label_assigned_to_me_issues: Issues assigned to me
+ label_updated_issues: Updated issues
label_last_login: Last connection
label_registered_on: Registered on
label_activity: Activity
diff --git a/lib/redmine/my_page.rb b/lib/redmine/my_page.rb
index 85b00f36f..923479aef 100644
--- a/lib/redmine/my_page.rb
+++ b/lib/redmine/my_page.rb
@@ -26,6 +26,7 @@ module Redmine
CORE_BLOCKS = {
'issuesassignedtome' => {:label => :label_assigned_to_me_issues},
'issuesreportedbyme' => {:label => :label_reported_issues},
+ 'issuesupdatedbyme' => {:label => :label_updated_issues},
'issueswatched' => {:label => :label_watched_issues},
'issuequery' => {:label => :label_issue_plural, :max_occurs => 3},
'news' => {:label => :label_news_latest},
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb
index dda67a185..d761d5b8e 100644
--- a/test/functional/my_controller_test.rb
+++ b/test/functional/my_controller_test.rb
@@ -21,7 +21,8 @@ require File.expand_path('../../test_helper', __FILE__)
class MyControllerTest < Redmine::ControllerTest
fixtures :users, :email_addresses, :user_preferences, :roles, :projects, :members, :member_roles,
- :issues, :issue_statuses, :trackers, :enumerations, :custom_fields, :auth_sources, :queries, :enabled_modules
+ :issues, :issue_statuses, :trackers, :enumerations, :custom_fields, :auth_sources, :queries, :enabled_modules,
+ :journals
def setup
@request.session[:user_id] = 2
@@ -218,6 +219,31 @@ class MyControllerTest < Redmine::ControllerTest
end
end
+ def test_page_with_updated_issues_block
+ preferences = User.find(2).pref
+ preferences.my_page_layout = {'top' => ['issuesupdatedbyme']}
+ preferences.my_page_settings = {'issuesupdatedbyme' => {}}
+ preferences.save!
+
+ project = Project.find(3)
+ project.close
+
+ get :page
+
+ assert_response :success
+ assert_select '#block-issuesupdatedbyme' do
+ report_url = CGI.unescape(css_select('h3 a').first.attr('href'))
+ assert_match 'f[]=project.status', report_url
+ assert_match 'v[project.status][]=1', report_url
+ assert_match 'f[]=updated_by', report_url
+ assert_match 'v[updated_by][]=me', report_url
+
+ assert_select 'table.issues tbody tr', 2
+ assert_select 'table.issues tbody tr[id=?]', 'issue-1', 1, :title => 'Cannot print recipes'
+ assert_select 'table.issues tbody tr[id=?]', 'issue-14', 0
+ end
+ end
+
def test_page_with_all_blocks
blocks = Redmine::MyPage.blocks.keys
preferences = User.find(2).pref