Karel Pičman 2018-11-08 14:04:19 +01:00
parent a78be36c38
commit abcda470f5
2 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@
'LEFT JOIN dmsf_workflow_step_actions ON dmsf_workflow_step_assignments.id = dmsf_workflow_step_actions.dmsf_workflow_step_assignment_id').where( 'LEFT JOIN dmsf_workflow_step_actions ON dmsf_workflow_step_assignments.id = dmsf_workflow_step_actions.dmsf_workflow_step_assignment_id').where(
:dmsf_workflow_step_assignments => { :user_id => @user.id }).where( :dmsf_workflow_step_assignments => { :user_id => @user.id }).where(
['dmsf_workflow_step_actions.id IS NULL OR dmsf_workflow_step_actions.action = ?', DmsfWorkflowStepAction::ACTION_DELEGATE]) %> ['dmsf_workflow_step_actions.id IS NULL OR dmsf_workflow_step_actions.action = ?', DmsfWorkflowStepAction::ACTION_DELEGATE]) %>
<% all_assignments.each do |assignment| %> <% all_assignments.find_each do |assignment| %>
<% if assignment.dmsf_file_revision.dmsf_file.last_revision && <% if assignment.dmsf_file_revision.dmsf_file.last_revision &&
!assignment.dmsf_file_revision.dmsf_file.last_revision.deleted? && !assignment.dmsf_file_revision.dmsf_file.last_revision.deleted? &&
(assignment.dmsf_file_revision.workflow == DmsfWorkflow::STATE_WAITING_FOR_APPROVAL) && (assignment.dmsf_file_revision.workflow == DmsfWorkflow::STATE_WAITING_FOR_APPROVAL) &&
@ -36,10 +36,10 @@
<% end %> <% end %>
<% end %> <% end %>
<% unless defined?(EasyExtensions) %> <% unless defined?(EasyExtensions) %>
<h3><%= l(:open_approvals)%> (<%= assignments.count %>)</h3> <h3><%= l(:open_approvals)%> (<%= assignments.size %>)</h3>
<% end %> <% end %>
<% if assignments.any? %> <% if assignments.any? %>
<%= form_tag({}) do %> <%= form_tag do %>
<table class="list"> <table class="list">
<thead> <thead>
<tr> <tr>

View File

@ -23,9 +23,9 @@ require File.expand_path('../../test_helper', __FILE__)
class MyControllerTest < RedmineDmsf::Test::TestCase class MyControllerTest < RedmineDmsf::Test::TestCase
include Redmine::I18n include Redmine::I18n
fixtures :users, :email_addresses, :user_preferences, :projects, fixtures :users, :email_addresses, :user_preferences, :projects, :dmsf_workflows, :dmsf_workflow_steps,
:dmsf_workflows, :dmsf_workflow_steps, :dmsf_workflow_step_assignments, :dmsf_workflow_step_assignments, :dmsf_workflow_step_actions, :dmsf_file_revisions, :dmsf_folders,
:dmsf_file_revisions, :dmsf_folders, :dmsf_files, :dmsf_locks :dmsf_files, :dmsf_locks
def setup def setup
@user_member = User.find 2 @user_member = User.find 2
@ -44,7 +44,7 @@ class MyControllerTest < RedmineDmsf::Test::TestCase
assert_response :success assert_response :success
unless defined?(EasyExtensions) unless defined?(EasyExtensions)
assert_select 'div#list-top' do assert_select 'div#list-top' do
assert_select 'h3', { :text => "#{l(:open_approvals)} (3)" } assert_select 'h3', { :text => "#{l(:open_approvals)} (1)" }
end end
end end
end end