Merge branch 'master' into devel-2.4.4

This commit is contained in:
karel.picman@lbcfree.net 2020-06-26 12:40:53 +02:00
commit f3f9454e27
9 changed files with 15 additions and 20 deletions

View File

@ -49,6 +49,9 @@ after_script:
- bash -x ./test/ci/redmine_install.sh -u
env:
- DB=sqlite REDMINE_GIT_TAG=4.0-stable
- DB=mysql REDMINE_GIT_TAG=4.0-stable
- DB=postgres REDMINE_GIT_TAG=4.0-stable
- DB=sqlite REDMINE_GIT_TAG=4.1-stable
- DB=mysql REDMINE_GIT_TAG=4.1-stable
- DB=postgres REDMINE_GIT_TAG=4.1-stable

View File

@ -36,12 +36,12 @@ Features
* Documents and folders symbolic links
* Trash bin
* Documents attachable to issues
* Compatible with Redmine 4.1.x
* Compatible with Redmine 4.0.x and 4.1.x
Dependencies
------------
* Redmine 4.1.0 or higher
* Redmine 4.0.0 or higher
### Full-text search (optional)
@ -224,7 +224,7 @@ You can either clone the master branch or download the latest zipped version. Be
`RAILS_ENV=production bundle exec rake db:migrate`
`RAILS_ENV=production bundle exec rake plugins:migrate NAME=redmine_dmsf`
`RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf`
5. The access rights must be set for web server, example: `chown -R www-data:www-data plugins/redmine_dmsf`.
6. Restart the web server, e.g. `systemctl apache2 restart`
7. You should configure the plugin via Redmine interface: Administration -> Plugins -> DMSF -> Configure.

View File

@ -85,7 +85,8 @@ class DmsfFilesController < ApplicationController
@revision = @file.last_revision
@file_delete_allowed = User.current.allowed_to?(:file_delete, @project)
@file_manipulation_allowed = User.current.allowed_to?(:file_manipulation, @project)
@revision_pages = Paginator.new @file.dmsf_file_revisions.visible.count, params['per_page'] ? params['per_page'].to_i : 25, params['page']
@revision_count = @file.dmsf_file_revisions.visible.all.size
@revision_pages = Paginator.new @revision_count, params['per_page'] ? params['per_page'].to_i : 25, params['page']
respond_to do |format|
format.html {

View File

@ -35,7 +35,7 @@ class DmsfFileRevisionAccessQuery < Query
QueryColumn.new(:last_at, frozen: true)
]
def initialize(attributes)
def initialize(attributes=nil, *args)
super attributes
self.sort_criteria = []
self.filters = {}
@ -73,8 +73,6 @@ class DmsfFileRevisionAccessQuery < Query
@available_columns
end
#alias default_columns_names available_columns
######################################################################################################################
# New
@ -82,7 +80,7 @@ class DmsfFileRevisionAccessQuery < Query
base_scope.
access_grouped.
joins(:user).
order('`count` DESC').
order(Arel.sql('COUNT(*) DESC')).
limit(options[:limit]).
offset(options[:offset])
end

View File

@ -135,7 +135,7 @@ class DmsfQuery < Query
# New
def dmsf_nodes(options={})
order_option = ['sort', group_by_sort_order, (options[:order] || sort_clause[0]), 'title'].flatten.reject(&:blank?)
order_option = ['sort', group_by_sort_order, (options[:order] || sort_clause[0])].flatten.reject(&:blank?)
if order_option.size > 2
DmsfFileRevisionCustomField.visible.pluck(:id, :name).each do |id, name|
order_option[1].gsub!("COALESCE(cf_#{id}.value, '')", "\"#{name}\"")

View File

@ -22,7 +22,7 @@
<li>
<%= context_menu_link l(:button_edit), dmsf_file_path(id: dmsf_file), class: 'icon icon-edit',
disabled: !allowed || locked %>
disabled: !allowed || (locked && !unlockable) %>
</li>
<li>
<%= link_to "#{l(:button_copy)}/#{l(:button_move)}", copy_file_path(id: dmsf_file),

View File

@ -44,4 +44,3 @@
</tbody>
</table>
</div>
<span class="pagination"><%= pagination_links_full revision_access_pages, revision_access_count %></span>

View File

@ -158,20 +158,14 @@
<% if @file_manipulation_allowed %>
<% revision_access_query = DmsfFileRevisionAccessQuery.new %>
<% revision_access_query.revision_id = revision.id %>
<% revision_access_count = revision_access_query.access_count %>
<% revision_access_pages = Redmine::Pagination::Paginator.new revision_access_count,
Setting.per_page_options_array.first || 25, params['page'] %>
<%= render partial: 'revision_access', locals: { revision: revision, query: revision_access_query,
revision_access_count: revision_access_count,
revision_access_pages: revision_access_pages } %>
<%= render partial: 'revision_access', locals: { revision: revision, query: revision_access_query } %>
<% end %>
</div>
</div>
</div>
<br/>
<% end %>
<span class="pagination"><%= pagination_links_full @revision_pages, @file.dmsf_file_revisions.visible.count %></span>
<span class="pagination"><%= pagination_links_full @revision_pages, @revision_count %></span>
<%= late_javascript_tag do %>
$('a.delete-revision').click(function(event) {

View File

@ -35,7 +35,7 @@ Redmine::Plugin.register :redmine_dmsf do
description 'Document Management System Features'
version '2.4.4 devel'
requires_redmine version_or_higher: '4.1.0'
requires_redmine version_or_higher: '4.0.0'
settings partial: 'settings/dmsf_settings',
default: {