#48 No add approval workflow button when assigning workflow to issue

This commit is contained in:
Karel Picman 2017-08-29 13:30:15 +02:00
parent 23bc159db7
commit f2c0b5b217
3 changed files with 14 additions and 9 deletions

View File

@ -51,9 +51,9 @@
<span class="icon-only"></span> <span class="icon-only"></span>
<% end %> <% end %>
<% # Email %> <% # Email %>
<%= link_to('', entries_operations_dmsf_path(:id => dmsf_file.project, :email_entries => 'email', :files => [dmsf_file.id]), :method => :post, <%= link_to('', entries_operations_dmsf_path(:id => dmsf_file.project_id, :email_entries => 'email',
:title => l(:heading_send_documents_by_email), :files => [dmsf_file.id]), :method => :post, :title => l(:heading_send_documents_by_email),
:class => 'icon-only icon-email-disabled') %> :class => 'icon-only icon-email-disabled') %>
<% # Lock %> <% # Lock %>
<% if !dmsf_file.locked? %> <% if !dmsf_file.locked? %>
<%= link_to('', lock_dmsf_files_path(:id => dmsf_file), <%= link_to('', lock_dmsf_files_path(:id => dmsf_file),
@ -95,7 +95,7 @@
<%= render(:partial => 'dmsf_files/approval_workflow_button', <%= render(:partial => 'dmsf_files/approval_workflow_button',
:locals => {:file => dmsf_file, :locals => {:file => dmsf_file,
:file_approval_allowed => User.current.allowed_to?(:file_approval, dmsf_file.project), :file_approval_allowed => User.current.allowed_to?(:file_approval, dmsf_file.project),
:workflows_available => DmsfWorkflow.where(['project_id = ? OR project_id IS NULL', dmsf_file.project.id]).exists?, :workflows_available => DmsfWorkflow.where(['project_id = ? OR project_id IS NULL', dmsf_file.project_id]).exists?,
:project => dmsf_file.project, :wf => wf, :dmsf_link_id => nil }) %> :project => dmsf_file.project, :wf => wf, :dmsf_link_id => nil }) %>
</span> </span>
</p> </p>

View File

@ -17,11 +17,13 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%> # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<h3 class="title"><%= l(:field_label_dmsf_workflow) %></h3> <h3 class="title"><%= l(:field_label_dmsf_workflow) %></h3>
<% remote = params[:dmsf_link_id] || params[:attachment_id] %>
<%= form_tag({:controller => 'dmsf_workflows', :action => 'assignment'}, <%= form_tag({:controller => 'dmsf_workflows', :action => 'assignment'},
:method => :post, :id => 'assignment-form', :remote => params[:dmsf_link_id] || params[:attachment_id]) do %> :method => :post, :id => 'assignment-form', :remote => remote) do %>
<%= hidden_field_tag :dmsf_file_revision_id, params[:dmsf_file_revision_id] %> <%= hidden_field_tag :dmsf_file_revision_id, params[:dmsf_file_revision_id] %>
<%= hidden_field_tag :dmsf_link_id, params[:dmsf_link_id] %> <%= hidden_field_tag :dmsf_link_id, params[:dmsf_link_id] %>
<%= hidden_field_tag :attachment_id, params[:attachment_id] %> <%= hidden_field_tag :attachment_id, params[:attachment_id] %>
@ -31,9 +33,10 @@
'dmsf_workflow_id', 'dmsf_workflow_id',
dmsf_workflows_for_select(@project, nil))%> dmsf_workflows_for_select(@project, nil))%>
</p> </p>
<% if User.current.allowed_to?(:manage_workflows, @project) %> <% if (!remote) && User.current.allowed_to?(:manage_workflows, @project) %>
<p> <p>
<%= link_to l(:label_dmsf_workflow_new), new_dmsf_workflow_path(:project_id => @project.id), :class => 'icon icon-add' %> <%= link_to l(:label_dmsf_workflow_new), new_dmsf_workflow_path(:project_id => @project.id),
:class => 'icon icon-add' %>
</p> </p>
<% end %> <% end %>
<p class="buttons"> <p class="buttons">

View File

@ -1,7 +1,9 @@
<% <%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-17 Karel Pičman <karel.picman@kontron.com>
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License