#95 DMSF tab missing on closed projects
This commit is contained in:
parent
c2117d561a
commit
d423d471fe
@ -33,6 +33,9 @@ class DmsfController < ApplicationController
|
||||
helper :all
|
||||
|
||||
def show
|
||||
@folder_manipulation_allowed = User.current.allowed_to?(:folder_manipulation, @project)
|
||||
@file_manipulation_allowed = User.current.allowed_to?(:folder_manipulation, @project)
|
||||
|
||||
unless @folder
|
||||
@subfolders = @project.dmsf_folders.visible
|
||||
@files = @project.dmsf_files.visible
|
||||
|
||||
@ -134,6 +134,7 @@
|
||||
<td class="workflow"></td>
|
||||
<td class="author"><%= h(subfolder.user) %></td>
|
||||
<td class="actions">
|
||||
<% if @folder_manipulation_allowed %>
|
||||
<% if User.current.allowed_to?(:file_approval, @project) %>
|
||||
<div class="right_icon_box" style="width:26px;">
|
||||
<% if subfolder.notification %>
|
||||
@ -148,13 +149,11 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="right_icon_box" style="width: 70px;">
|
||||
<% if User.current.allowed_to?(:folder_manipulation, @project) %>
|
||||
<div style="float: left">
|
||||
<%= link_to(image_tag('edit.png', :class =>'detail_icon'),
|
||||
{:action => 'edit', :id => @project, :folder_id => subfolder },
|
||||
:title => l(:link_edit, :title => h(subfolder.title))) unless locked_for_user %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="float: right; width: 44px;">
|
||||
<% unless locked_for_user && !User.current.allowed_to?(:force_file_unlock, @project)%>
|
||||
<% if locked %>
|
||||
@ -175,13 +174,13 @@
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<% jetzt = Time.now %>
|
||||
<%= link_to_function(image_tag('delete.png', :plugin => :redmine_dmsf),
|
||||
"confirmation_link('#{url_for(:action => 'delete', :id => @project, :folder_id => @folder, :delete_folder_id => subfolder)}', '#{l(:question_do_you_really_want_to_delete_this_entry)}')",
|
||||
:title => l(:title_delete)) unless locked_for_user %>
|
||||
</div>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hidden">0</td>
|
||||
<td class="hidden">0</td>
|
||||
@ -220,7 +219,7 @@
|
||||
</td>
|
||||
<td class="version"><%= file.last_revision.version %></td>
|
||||
<td class="workflow">
|
||||
<% if wf %>
|
||||
<% if wf && @file_manipulation_allowed %>
|
||||
<%= link_to(
|
||||
file.last_revision.workflow_str(false),
|
||||
log_dmsf_workflow_path(
|
||||
@ -235,6 +234,7 @@
|
||||
</td>
|
||||
<td class="author"><%= h(file.last_revision.user) %></td>
|
||||
<td class="actions">
|
||||
<% if @file_manipulation_allowed %>
|
||||
<% if User.current.allowed_to?(:file_approval, @project) %>
|
||||
<div class="right_icon_box" style="width:26px;">
|
||||
<% if file.notification %>
|
||||
@ -318,7 +318,7 @@
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<% if User.current.allowed_to?(:file_manipulation, @project) && !locked_for_user %>
|
||||
<% unless locked_for_user %>
|
||||
<%= link_to_function(image_tag('delete.png', :plugin => :redmine_dmsf),
|
||||
"confirmation_link('#{url_for(:controller => 'dmsf_files', :action => 'delete', :id => file)}', '#{l(:question_do_you_really_want_to_delete_this_entry)}')",
|
||||
:title => l(:title_delete)) %>
|
||||
@ -326,6 +326,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hidden">1</td>
|
||||
<td class="hidden"><%= file.last_revision.size %></td>
|
||||
@ -411,5 +412,5 @@ sUrl = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" if I18n.locale && !
|
||||
</script>
|
||||
<% end %>
|
||||
|
||||
<%= render(:partial => 'multi_upload') if (User.current.allowed_to?(:file_manipulation, @project) && !@locked_for_user) %>
|
||||
<%= render(:partial => 'multi_upload') if (@file_manipulation_allowed && !@locked_for_user) %>
|
||||
<br/>
|
||||
|
||||
4
init.rb
4
init.rb
@ -49,10 +49,10 @@ Redmine::Plugin.register :redmine_dmsf do
|
||||
activity_provider :dmsf_files, :class_name => 'DmsfFileRevision', :default => true
|
||||
|
||||
project_module :dmsf do
|
||||
permission :view_dmsf_folders, {:dmsf => [:show], :dmsf_folders_copy => [:new, :copy_to, :move_to]}
|
||||
permission :view_dmsf_folders, {:dmsf => [:show], :dmsf_folders_copy => [:new, :copy_to, :move_to]}, :read => true
|
||||
permission :user_preferences, {:dmsf_state => [:user_pref_save]}
|
||||
permission :view_dmsf_files, {:dmsf => [:entries_operation, :entries_email],
|
||||
:dmsf_files => [:show], :dmsf_files_copy => [:new, :create, :move]}
|
||||
:dmsf_files => [:show], :dmsf_files_copy => [:new, :create, :move]}, :read => true
|
||||
permission :folder_manipulation, {:dmsf => [:new, :create, :delete, :edit, :save, :edit_root, :save_root, :lock, :unlock]}
|
||||
permission :file_manipulation, {:dmsf_files => [:create_revision, :delete, :lock, :unlock],
|
||||
:dmsf_upload => [:upload_files, :upload_file, :commit_files]}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user