Broken paging on the Add approver form #662
This commit is contained in:
parent
6f709924b5
commit
197b9a52a2
@ -22,6 +22,7 @@ Changelog for Redmine DMSF
|
||||
Global title format for downloading
|
||||
New columns in the main DMSF view; columns are configurable from the plugin settings
|
||||
|
||||
* Bug: #662 - Broken paging on the Add approver form
|
||||
* Bug: #651 - Incomplete copy of a file to another project
|
||||
* New: #641 - Documents export
|
||||
* New: #635 - Edit approval workflow steps
|
||||
|
||||
@ -279,7 +279,9 @@ class DmsfWorkflowsController < ApplicationController
|
||||
end
|
||||
|
||||
def autocomplete_for_user
|
||||
render :layout => false
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def new_step
|
||||
|
||||
@ -20,11 +20,11 @@
|
||||
|
||||
module DmsfWorkflowsHelper
|
||||
|
||||
def render_principals_for_new_dmsf_workflow_users(workflow, dmsf_workflow_step_assignment_id, dmsf_file_revision_id)
|
||||
def render_principals_for_new_dmsf_workflow_users(workflow, dmsf_workflow_step_assignment_id = nil, dmsf_file_revision_id = nil)
|
||||
scope = workflow.delegates(params[:q], dmsf_workflow_step_assignment_id, dmsf_file_revision_id)
|
||||
principal_count = scope.count
|
||||
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page']
|
||||
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
|
||||
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).to_a
|
||||
|
||||
# Delegation
|
||||
if dmsf_workflow_step_assignment_id
|
||||
@ -42,8 +42,7 @@ module DmsfWorkflowsHelper
|
||||
link_to text, autocomplete_for_user_dmsf_workflow_path(workflow, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
||||
}
|
||||
|
||||
s += content_tag('p', links, :class => 'pagination')
|
||||
s.html_safe
|
||||
s + content_tag('span', links, :class => 'pagination')
|
||||
end
|
||||
|
||||
def dmsf_workflow_steps_options_for_select(steps)
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
<p><%= label_tag 'user_search', l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
|
||||
<%= javascript_tag "observeSearchfield('user_search', 'users', '#{ escape_javascript autocomplete_for_user_dmsf_workflow_path(@dmsf_workflow, :dmsf_workflow_step_assignment_id => nil, :dmsf_file_revision_id => nil, :project_id => @project ? @project.id : nil) }')" %>
|
||||
|
||||
<div id="users">
|
||||
<%= render_principals_for_new_dmsf_workflow_users(@dmsf_workflow, nil, nil) %>
|
||||
<div id="new_approvers">
|
||||
<%= render_principals_for_new_dmsf_workflow_users(@dmsf_workflow) %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@ -29,4 +29,4 @@
|
||||
<%= f.submit l(:dmsf_or), :id => 'add-step-or' %>
|
||||
<%= f.submit l(:button_cancel), :name => nil, :onclick => 'hideModal(this);', :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<%# Redmine plugin for Document Management System "Features"
|
||||
<%
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Copyright (C) 2013 Karel Pičman <karel.picman@kontron.com>
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 Karel Pičman <karel.picman@kontron.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -14,6 +17,7 @@
|
||||
#
|
||||
# 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.%>
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
%>
|
||||
|
||||
<%= render 'steps' %>
|
||||
<%= render 'steps' %>
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
<%# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2013 Karel Pičman <karel.picman@kontron.com>
|
||||
#
|
||||
# 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.%>
|
||||
|
||||
<%= render_principals_for_new_dmsf_workflow_users(@dmsf_workflow, params[:dmsf_workflow_step_assignment_id], params[:dmsf_file_revision_id]) %>
|
||||
3
app/views/dmsf_workflows/autocomplete_for_user.js.erb
Normal file
3
app/views/dmsf_workflows/autocomplete_for_user.js.erb
Normal file
@ -0,0 +1,3 @@
|
||||
$('#new_approvers').html('<%= escape_javascript(
|
||||
render_principals_for_new_dmsf_workflow_users(
|
||||
@dmsf_workflow, params[:dmsf_workflow_step_assignment_id], params[:dmsf_file_revision_id])) %>');
|
||||
Loading…
x
Reference in New Issue
Block a user