Merge branch 'release/4.2' into dev

pull/6827/head
Jens Ulferts 10 years ago
commit 0e8aecf5da
  1. 42
      app/views/hooks/_view_projects_show_sidebar_bottom_hook.html.erb
  2. 19
      features/links.feature
  3. 6
      lib/open_project/reporting/engine.rb
  4. 3
      lib/open_project/reporting/hooks.rb

@ -1,42 +0,0 @@
<%#-- copyright
OpenProject Reporting Plugin
Copyright (C) 2010 - 2014 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++#%>
<script type="text/javascript">
//<![CDATA[
remove_old_sidebar = function() {
if ($($("sidebar").down()).innerHTML === "<%= l(:label_spent_time) %>") {
var reporting_link, old_html;
// The sidebar is showing spent time, remove the links, which are in the second para
$("sidebar").down().siblings()[1].remove();
// Make the hours a link, which are in the first para
reporting_link = "<%= raw link_to('PLACEHOLDER', {
:controller => 'cost_reports', :project_id => project,
:unit => -1, :set_filter => 1,
:values => {:project_id => [project.id]},
:operators => {:project_id => '='},
:fields => [:project_id] }).gsub('"', "'") %>";
old_html = $("sidebar").down().siblings().first().innerHTML;
$("sidebar").down().siblings().first().innerHTML = reporting_link.replace("PLACEHOLDER", old_html)
}
}
remove_old_sidebar();
//]]>
</script>

@ -147,25 +147,6 @@ Feature: Cost Reporting Linkage
And I should not see "50.00" And I should not see "50.00"
And I should not see "150.00" And I should not see "150.00"
@javascript
Scenario: Reporting on the project page should be accessible from the spent time
Given there is a standard cost control project named "Standard Project"
And the project "Standard Project" has 1 issue with the following:
| subject | test_work_package |
And the issue "test_work_package" has 1 time entry with the following:
| hours | 1.00 |
| user | manager |
And I am already logged in as "manager"
When I am on the page for the project "Standard Project"
Then I see spent time within "#sidebar"
And I should see "1.00 hour" within "#sidebar"
And I should not see "Details" within "#sidebar"
And I should not see "Report" within "#sidebar"
When I follow "1.00 hour"
Then I should be on the Cost Reports page for the project called "Standard Project"
@javascript @javascript
Scenario: Jump to project from the cost report jumps to the cost report of the selected project Scenario: Jump to project from the cost report jumps to the cost report of the selected project
Given there is a standard cost control project named "First Project" Given there is a standard cost control project named "First Project"

@ -58,10 +58,14 @@ module OpenProject::Reporting
menu :project_menu, :cost_reports, menu :project_menu, :cost_reports,
{controller: 'cost_reports', action: 'index'}, {controller: 'cost_reports', action: 'index'},
param: :project_id, param: :project_id,
after: :cost_objects, after: :time_entries,
caption: :cost_reports_title, caption: :cost_reports_title,
if: Proc.new { |project| project.module_enabled?(:reporting_module) }, if: Proc.new { |project| project.module_enabled?(:reporting_module) },
html: { class: 'icon2 icon-stats' } html: { class: 'icon2 icon-stats' }
hide_menu_item :project_menu,
:time_entries,
hide_if: -> (project) { project.module_enabled?(:reporting_module) }
end end
initializer "reporting.register_hooks" do initializer "reporting.register_hooks" do

@ -17,6 +17,5 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#++ #++
class ViewProjectsShowSidebarBottomHook < Redmine::Hook::ViewListener module OpenProject::Reporting::Hooks
render_on :view_projects_show_sidebar_bottom, partial: 'hooks/view_projects_show_sidebar_bottom_hook'
end end

Loading…
Cancel
Save