diff --git a/app/views/dmsf/_sidebar.html.erb b/app/views/dmsf/_sidebar.html.erb
new file mode 100644
index 00000000..2e6cc583
--- /dev/null
+++ b/app/views/dmsf/_sidebar.html.erb
@@ -0,0 +1,25 @@
+<%
+ # encoding: utf-8
+ #
+ # Redmine plugin for Document Management System "Features"
+ #
+ # Copyright © 2011 Vít Jonáš
+ # Copyright © 2012 Daniel Munn
+ # Copyright © 2011-20 Karel Pičman
+ #
+ # 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_sidebar_queries DmsfQuery, @project %>
diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb
index 739c695d..c7c83448 100644
--- a/app/views/dmsf/show.html.erb
+++ b/app/views/dmsf/show.html.erb
@@ -84,3 +84,7 @@
<%= f.link_to 'CSV', url: { action: :show, id: @project, dmsf_folder_id: @folder } %>
<% end %>
<% end %>
+
+<% content_for :sidebar do %>
+ <%= render partial: 'dmsf/sidebar' %>
+<% end %>
diff --git a/app/views/dmsf/trash.html.erb b/app/views/dmsf/trash.html.erb
index 9d0f2f99..510e3f44 100644
--- a/app/views/dmsf/trash.html.erb
+++ b/app/views/dmsf/trash.html.erb
@@ -43,3 +43,7 @@
<%= context_menu %>
+
+<% content_for :sidebar do %>
+ <%= render partial: 'dmsf/sidebar' %>
+<% end %>
diff --git a/assets/stylesheets/redmine_dmsf.css b/assets/stylesheets/redmine_dmsf.css
index 23ab6636..9e31f3df 100644
--- a/assets/stylesheets/redmine_dmsf.css
+++ b/assets/stylesheets/redmine_dmsf.css
@@ -343,10 +343,17 @@ div[id*="revision_access_"] {
}
/* EasyExtensions - font icons */
-.icon-actions::before {
+table.dmsf > tbody > tr > td a.icon-actions::before {
content: "\F1D8";
}
+#sidebar ul > li > a.icon-only.icon-clear-query {
+ background-image: url(../../../images/close_hl.png);
+ background-repeat: no-repeat;
+ padding-left: 16px;
+ margin-left: 8px;
+}
+
table.dmsf a.sort {
padding-right: 16px;
background-position: 100% 50%;
diff --git a/lib/redmine_dmsf.rb b/lib/redmine_dmsf.rb
index bd18404f..9f2010b4 100644
--- a/lib/redmine_dmsf.rb
+++ b/lib/redmine_dmsf.rb
@@ -38,6 +38,7 @@ require 'redmine_dmsf/patches/user_preference_patch'
require 'redmine_dmsf/patches/user_patch'
require 'redmine_dmsf/patches/issue_patch'
require 'redmine_dmsf/patches/role_patch'
+require 'redmine_dmsf/patches/queries_controller_patch'
if defined?(EasyExtensions)
require 'redmine_dmsf/patches/easy_crm_case_patch'
diff --git a/lib/redmine_dmsf/patches/queries_controller_patch.rb b/lib/redmine_dmsf/patches/queries_controller_patch.rb
new file mode 100644
index 00000000..788bdab7
--- /dev/null
+++ b/lib/redmine_dmsf/patches/queries_controller_patch.rb
@@ -0,0 +1,40 @@
+# encoding: utf-8
+# frozen_string_literal: true
+#
+# Redmine plugin for Document Management System "Features"
+#
+# Copyright © 2011-20 Karel Pičman
+#
+# 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.
+#
+module RedmineDmsf
+ module Patches
+ module QueriesControllerPatch
+
+ ##################################################################################################################
+ # New methods
+
+ private
+
+ def redirect_to_dmsf_query(options)
+ redirect_to dmsf_folder_path(@project, options)
+ end
+
+ end
+ end
+end
+
+RedmineExtensions::PatchManager.register_controller_patch 'QueriesController',
+ 'RedmineDmsf::Patches::QueriesControllerPatch', prepend: true
\ No newline at end of file