<%# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2013 Karel Picman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # 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. %> <% all_assignments = DmsfWorkflowStepAssignment.joins( '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 = ? AND dmsf_workflow_step_actions.id IS NULL', @user.id).all %> <% assignments = Array.new %> <% all_assignments.each do |assignment| %> <% if assignment.dmsf_file_revision == assignment.dmsf_file_revision.file.last_revision %> <% assignments << assignment %> <% end %> <% end %>

<%= l(:label_my_open_approvals)%> (<%= assignments.count %>)

<% if assignments.any? %> <%= form_tag({}) do %> <% assignments.each do |assignment| %> <% end %>
<%=l(:field_project)%> <%=l(:field_label_dmsf_workflow)%> <%=l(:label_document)%> <%=l(:field_folder)%>
<% if assignment.dmsf_file_revision.file.project %> <%= link_to_project(assignment.dmsf_file_revision.file.project) %> <% end %> <% if assignment.dmsf_workflow_step && assignment.dmsf_workflow_step.dmsf_workflow %> <%= link_to(h(assignment.dmsf_workflow_step.dmsf_workflow.name), edit_dmsf_workflow_path(assignment.dmsf_workflow_step.dmsf_workflow)) %> <% end %> <% if assignment.dmsf_file_revision && assignment.dmsf_file_revision.file %> <%= link_to(h(assignment.dmsf_file_revision.title), {:controller => 'dmsf_files', :action => :show, :id => assignment.dmsf_file_revision.file }) %> <% end %> <% if assignment.dmsf_file_revision %> <% if assignment.dmsf_file_revision.file.folder %> <%= link_to(h(assignment.dmsf_file_revision.file.folder.title), {:controller => 'dmsf', :action => 'show', :id => assignment.dmsf_file_revision.file.project, :folder_id => assignment.dmsf_file_revision.file.folder}) %> <% elsif assignment.dmsf_file_revision.file.project %> <%= link_to(l(:link_documents), {:controller => 'dmsf', :action => 'show', :id => assignment.dmsf_file_revision.file.project }) %> <% end %> <% end %>
<% end %> <% end %>