#183 Link to & Link from added

This commit is contained in:
Karel Picman 2014-02-28 12:31:18 +01:00
parent 79a3216d40
commit d8390053f3
32 changed files with 557 additions and 192 deletions

View File

@ -1,6 +1,6 @@
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2014 Karel Pičman <karel.picman@lbcfree.net> # Copyright (C) 2011-14 Karel Pičman <karel.picman@lbcfree.net>
# #
# 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
@ -25,44 +25,75 @@ class DmsfLinksController < ApplicationController
before_filter :authorize before_filter :authorize
def new def new
@dmsf_link = DmsfLink.new @dmsf_link = DmsfLink.new(:project_id => params[:project_id])
@dmsf_link.project_id = @project.id
@dmsf_link.target_type = DmsfFolder.model_name
@dmsf_link.dmsf_folder_id = params[:dmsf_folder_id]
if params[:dmsf_link].present? if params[:dmsf_link].present?
@dmsf_link.target_project_id = params[:dmsf_link][:target_project_id] # Reload
@target_folder_id = DmsfLinksHelper.is_a_number?(params[:dmsf_link][:target_folder_id]) ? params[:dmsf_link][:target_folder_id].to_i : nil @dmsf_link.dmsf_folder_id = params[:dmsf_link][:dmsf_folder_id]
@dmsf_file_id = params[:dmsf_link][:dmsf_file_id]
@type = params[:dmsf_link][:type]
@dmsf_link.target_project_id = params[:dmsf_link][:target_project_id]
@target_folder_id = params[:dmsf_link][:target_folder_id].to_i if params[:reload].blank? && DmsfLinksHelper.is_a_number?(params[:dmsf_link][:target_folder_id])
else else
@dmsf_link.target_project_id = @project.id # Link from/to
@target_folder_id = @dmsf_link.dmsf_folder_id @dmsf_link.dmsf_folder_id = params[:dmsf_folder_id]
end @dmsf_file_id = params[:dmsf_file_id]
@type = params[:type]
@dmsf_link.target_project_id = params[:project_id]
@target_folder_id = params[:dmsf_folder_id].to_i if params[:dmsf_folder_id].present?
end
render :layout => !request.xhr? render :layout => !request.xhr?
end end
def create def create
@dmsf_link = DmsfLink.new @dmsf_link = DmsfLink.new
@dmsf_link.project_id = @project.id
@dmsf_link.target_project_id = params[:dmsf_link][:target_project_id]
@dmsf_link.dmsf_folder_id = params[:dmsf_link][:dmsf_folder_id]
if params[:dmsf_link][:target_file_id].present? if params[:dmsf_link][:type] == 'link_from'
@dmsf_link.target_id = params[:dmsf_link][:target_file_id] # Link from
@dmsf_link.target_type = DmsfFile.model_name @dmsf_link.project_id = params[:dmsf_link][:project_id]
@dmsf_link.dmsf_folder_id = params[:dmsf_link][:dmsf_folder_id]
@dmsf_link.target_project_id = params[:dmsf_link][:target_project_id]
if params[:dmsf_link][:target_file_id].present?
@dmsf_link.target_id = params[:dmsf_link][:target_file_id]
@dmsf_link.target_type = DmsfFile.model_name
else
@dmsf_link.target_id = DmsfLinksHelper.is_a_number?(params[:dmsf_link][:target_folder_id]) ? params[:dmsf_link][:target_folder_id].to_i : nil
@dmsf_link.target_type = DmsfFolder.model_name
end
@dmsf_link.name = params[:dmsf_link][:name]
if @dmsf_link.save
flash[:notice] = l(:notice_successful_create)
redirect_to dmsf_folder_path(:id => @project.id, :folder_id => @dmsf_link.dmsf_folder_id)
else
render :action => 'new'
end
else else
@dmsf_link.target_id = DmsfLinksHelper.is_a_number?(params[:dmsf_link][:target_folder_id]) ? params[:dmsf_link][:target_folder_id].to_i : nil # Link to
@dmsf_link.target_type = DmsfFolder.model_name @dmsf_link.project_id = params[:dmsf_link][:target_project_id]
end @dmsf_link.dmsf_folder_id = DmsfLinksHelper.is_a_number?(params[:dmsf_link][:target_folder_id]) ? params[:dmsf_link][:target_folder_id].to_i : nil
@dmsf_link.target_project_id = params[:dmsf_link][:project_id]
@dmsf_link.name = params[:dmsf_link][:name] if params[:dmsf_link][:dmsf_file_id].present?
@dmsf_link.target_id = params[:dmsf_link][:dmsf_file_id]
if @dmsf_link.save @dmsf_link.target_type = DmsfFile.model_name
flash[:notice] = l(:notice_successful_create) else
redirect_to dmsf_folder_path(:id => @project.id, :folder_id => @dmsf_link.dmsf_folder_id) @dmsf_link.target_id = params[:dmsf_link][:dmsf_folder_id]
else @dmsf_link.target_type = DmsfFolder.model_name
render :action => 'new' end
end @dmsf_link.name = params[:dmsf_link][:name]
if @dmsf_link.save
flash[:notice] = l(:notice_successful_create)
if params[:dmsf_link][:dmsf_file_id].present?
redirect_to dmsf_file_path(@dmsf_link.target_file)
else
redirect_to edit_dmsf_path(:id => params[:dmsf_link][:project_id], :folder_id => params[:dmsf_link][:dmsf_folder_id])
end
else
render :action => 'new'
end
end
end end
def destroy def destroy
@ -88,4 +119,4 @@ class DmsfLinksController < ApplicationController
render_404 render_404
end end
end end

View File

@ -203,11 +203,7 @@ class DmsfFileRevision < ActiveRecord::Base
when 2 then self.major_version + 1 when 2 then self.major_version + 1
else self.major_version else self.major_version
end end
end end
def display_title
return self.title
end
def new_storage_filename def new_storage_filename
raise DmsfAccessError, 'File id is not set' unless self.file.id raise DmsfAccessError, 'File id is not set' unless self.file.id

View File

@ -1,6 +1,6 @@
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2014 Karel Pičman <karel.picman@lbcfree.net> # Copyright (C) 2011-14 Karel Pičman <karel.picman@lbcfree.net>
# #
# 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
@ -24,7 +24,7 @@ class DmsfLink < ActiveRecord::Base
validates :name, :presence => true validates :name, :presence => true
validates :target_id, :presence => true validates :target_id, :presence => true
validates_length_of :name, :maximum => 255 validates_length_of :name, :maximum => 255
scope :visible, :conditions => 'deleted = 0' scope :visible, :conditions => 'deleted = 0'
def target_folder_id def target_folder_id
if self.target_type == DmsfFolder.model_name if self.target_type == DmsfFolder.model_name
@ -36,7 +36,7 @@ class DmsfLink < ActiveRecord::Base
end end
def target_folder def target_folder
DmsfFolder.find self.target_folder_id if self.target_folder_id DmsfFolder.find_by_id self.target_folder_id if self.target_folder_id
end end
def target_file_id def target_file_id
@ -44,11 +44,11 @@ class DmsfLink < ActiveRecord::Base
end end
def target_file def target_file
DmsfFile.find self.target_file_id if self.target_file_id DmsfFile.find_by_id self.target_file_id if self.target_file_id
end end
def target_project def target_project
Project.find self.target_project_id Project.find_by_id self.target_project_id
end end
def folder def folder

View File

@ -28,8 +28,7 @@ class DmsfMailer < Mailer
files = files.select { |file| file.notify? } files = files.select { |file| file.notify? }
redmine_headers 'Project' => project.identifier if project redmine_headers 'Project' => project.identifier if project
@user = user
@files = files @files = files
@project = project @project = project
@ -45,8 +44,7 @@ class DmsfMailer < Mailer
files = files.select { |file| file.notify? } files = files.select { |file| file.notify? }
redmine_headers 'Project' => project.identifier if project redmine_headers 'Project' => project.identifier if project
@user = user
@files = files @files = files
@project = project @project = project

View File

@ -21,11 +21,11 @@
<% locked_for_user = subfolder.locked_for_user? %> <% locked_for_user = subfolder.locked_for_user? %>
<% locked = subfolder.locked? %> <% locked = subfolder.locked? %>
<td class="check"><%= check_box_tag(link ? 'dir_links[]' : 'subfolders[]', <td class="check"><%= check_box_tag(name, id, false,
link ? link.id : subfolder.id, false, :title => l(:title_check_for_zip_download_or_email)) %></td> :title => l(:title_check_for_zip_download_or_email)) %></td>
<td class="title"> <td class="title">
<%= link_to(h(link ? link.name : subfolder.title), <%= link_to(h(title),
dmsf_folder_path(:id => @project, :folder_id => subfolder), dmsf_folder_path(:id => project, :folder_id => subfolder),
:class => 'icon icon-folder') %> :class => 'icon icon-folder') %>
<div class="filename" title="<%= l(:title_number_of_files_in_directory)%>">[<%= subfolder.files.visible.count %>]</div> <div class="filename" title="<%= l(:title_number_of_files_in_directory)%>">[<%= subfolder.files.visible.count %>]</div>
</td> </td>
@ -54,21 +54,21 @@
<div class="right_icon_box"> <div class="right_icon_box">
<% unless locked %> <% unless locked %>
<%= link_to('', <%= link_to('',
edit_dmsf_path(:id => @project, :folder_id => subfolder), edit_dmsf_path(:id => project, :folder_id => subfolder),
:title => l(:link_edit, :title => h(subfolder.title)), :title => l(:link_edit, :title => h(subfolder.title)),
:class => 'icon icon-edit') %> :class => 'icon icon-edit') %>
<%= link_to('', <%= link_to('',
lock_dmsf_path(:id => @project, :folder_id => subfolder), lock_dmsf_path(:id => project, :folder_id => subfolder),
:title => l(:title_lock_file), :title => l(:title_lock_file),
:class => 'icon icon-dmsf-lock') %> :class => 'icon icon-dmsf-lock') %>
<% if subfolder.notification %> <% if subfolder.notification %>
<%= link_to('', <%= link_to('',
notify_deactivate_dmsf_path(:id => @project, :folder_id => subfolder), notify_deactivate_dmsf_path(:id => project, :folder_id => subfolder),
:title => l(:title_notifications_active_deactivate), :title => l(:title_notifications_active_deactivate),
:class => 'icon icon-notification-on') %> :class => 'icon icon-notification-on') %>
<% else %> <% else %>
<%= link_to('', <%= link_to('',
notify_activate_dmsf_path(:id => @project, :folder_id => subfolder), notify_activate_dmsf_path(:id => project, :folder_id => subfolder),
:title => l(:title_notifications_not_active_activate), :title => l(:title_notifications_not_active_activate),
:class => 'icon icon-notification-off') %> :class => 'icon icon-notification-off') %>
<% end %> <% end %>
@ -81,7 +81,7 @@
:class => 'icon icon-del') %> :class => 'icon icon-del') %>
<% else %> <% else %>
<%= link_to('', <%= link_to('',
delete_dmsf_path(:id => @project, :folder_id => @folder, :delete_folder_id => subfolder), delete_dmsf_path(:id => project, :folder_id => @folder, :delete_folder_id => subfolder),
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:title_delete), :title => l(:title_delete),
:class => 'icon icon-del') %> :class => 'icon icon-del') %>
@ -90,7 +90,7 @@
<span class="icon"></span> <span class="icon"></span>
<% if (!locked_for_user || @force_file_unlock_allowed) && subfolder.unlockable? %> <% if (!locked_for_user || @force_file_unlock_allowed) && subfolder.unlockable? %>
<%= link_to('', <%= link_to('',
unlock_dmsf_path(:id => @project, :folder_id => subfolder), unlock_dmsf_path(:id => project, :folder_id => subfolder),
:title => l(:title_unlock_file), :title => l(:title_unlock_file),
:class => 'icon icon-dmsf-unlock')%> :class => 'icon icon-dmsf-unlock')%>
<% end %> <% end %>

View File

@ -1,7 +1,7 @@
<%#= <%#=
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2014 Karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-14 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
@ -22,11 +22,11 @@
<% locked = file.locked? %> <% locked = file.locked? %>
<% wf = DmsfWorkflow.find_by_id(file.last_revision.dmsf_workflow_id) %> <% wf = DmsfWorkflow.find_by_id(file.last_revision.dmsf_workflow_id) %>
<td class="check"><%= check_box_tag(link ? 'file_links[]' : 'files[]', <td class="check"><%= check_box_tag(name, id, false,
link ? link.id : file.id, false, :title => l(:title_check_for_zip_download_or_email)) %></td> :title => l(:title_check_for_zip_download_or_email)) %></td>
<td class="title"> <td class="title">
<% file_download_url = url_for({:only_path => false, :controller => :dmsf_files, :action => 'show', :id => file, :download => ''}) %> <% file_download_url = url_for({:only_path => false, :controller => :dmsf_files, :action => 'show', :id => file, :download => ''}) %>
<%= link_to(h(link ? link.name : file.last_revision.display_title), <%= link_to(h(title),
file_download_url, file_download_url,
:class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}", :class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}",
:title => l(:title_title_version_version_download, :title => h(file.title), :version => file.version), :title => l(:title_title_version_version_download, :title => h(file.title), :version => file.version),
@ -58,7 +58,7 @@
<%= link_to( <%= link_to(
file.last_revision.workflow_str(false), file.last_revision.workflow_str(false),
log_dmsf_workflow_path( log_dmsf_workflow_path(
:project_id => @project.id, :project_id => project.id,
:id => wf.id, :id => wf.id,
:dmsf_file_revision_id => file.last_revision.id), :dmsf_file_revision_id => file.last_revision.id),
:title => DmsfWorkflow.assignments_to_users_str(wf.next_assignments(file.last_revision.id)), :title => DmsfWorkflow.assignments_to_users_str(wf.next_assignments(file.last_revision.id)),
@ -125,7 +125,7 @@
<% if index %> <% if index %>
<%= link_to('', <%= link_to('',
action_dmsf_workflow_path( action_dmsf_workflow_path(
:project_id => @project.id, :project_id => project.id,
:id => wf.id, :id => wf.id,
:dmsf_workflow_step_assignment_id => assignments[index].id, :dmsf_workflow_step_assignment_id => assignments[index].id,
:dmsf_file_revision_id => file.last_revision.id), :dmsf_file_revision_id => file.last_revision.id),
@ -165,7 +165,7 @@
<% if @workflows_available %> <% if @workflows_available %>
<%= link_to('', <%= link_to('',
assign_dmsf_workflow_path( assign_dmsf_workflow_path(
:project_id => @project.id, :project_id => project.id,
:dmsf_file_revision_id => file.last_revision.id), :dmsf_file_revision_id => file.last_revision.id),
:title => l(:label_dmsf_wokflow_action_assign), :title => l(:label_dmsf_wokflow_action_assign),
:class => 'icon icon-dmsf-none', :class => 'icon icon-dmsf-none',

View File

@ -36,7 +36,11 @@
notify_activate_dmsf_path(:id => @project, :folder_id => @folder), notify_activate_dmsf_path(:id => @project, :folder_id => @folder),
:title => l(:title_notifications_not_active_activate), :title => l(:title_notifications_not_active_activate),
:class => 'icon icon-notification-off') %> :class => 'icon icon-notification-off') %>
<% end %> <% end %>
<%= link_to(l(:label_link_to),
new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @folder.id, :type => 'link_to'),
:title => l(:link_create_link),
:class => 'icon icon-link') %>
<%= link_to(l(:button_copy), copy_folder_path(:id => @folder), <%= link_to(l(:button_copy), copy_folder_path(:id => @folder),
:title => l(:title_copy), :class => 'icon icon-copy') %> :title => l(:title_copy), :class => 'icon icon-copy') %>
<%= link_to(l(:button_delete), <%= link_to(l(:button_delete),

View File

@ -79,8 +79,8 @@
<% end %> <% end %>
<% end %> <% end %>
<% if @file_manipulation_allowed %> <% if @file_manipulation_allowed %>
<%= link_to(l(:label_create_link), <%= link_to(l(:label_link_from),
new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @folder ? @folder.id : @folder, :target_project_id => @project.id), new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @folder ? @folder.id : @folder, :type => 'link_from'),
:title => l(:link_create_link), :title => l(:link_create_link),
:class => 'icon icon-link') unless @locked_for_user %> :class => 'icon icon-link') unless @locked_for_user %>
<% end %> <% end %>
@ -131,12 +131,26 @@
<tbody> <tbody>
<% @subfolders.each do |subfolder| %> <% @subfolders.each do |subfolder| %>
<tr class="dir"> <tr class="dir">
<%= render(:partial => 'dir', :locals => {:subfolder => subfolder, :link => nil}) %> <%= render(:partial => 'dir',
:locals => {
:project => @project,
:subfolder => subfolder,
:link => nil,
:id => subfolder.id,
:name => 'subfolders[]',
:title => subfolder.title }) %>
</tr> </tr>
<% end %> <% end %>
<% @dir_links.each do |link| %> <% @dir_links.each do |link| %>
<tr class="gray"> <tr class="gray">
<%= render(:partial => 'dir', :locals => {:subfolder => link.target_folder, :link => link}) %> <%= render(:partial => 'dir',
:locals => {
:project => link.target_project,
:subfolder => link.target_folder,
:link => link,
:id => link.id,
:name => 'dir_links[]',
:title => link.name }) %>
</tr> </tr>
<% end %> <% end %>
<% @files.each do |file| %> <% @files.each do |file| %>
@ -145,7 +159,13 @@
<% next %> <% next %>
<% end %> <% end %>
<tr class="file"> <tr class="file">
<%= render(:partial => 'file', :locals => {:file => file, :link => nil}) %> <%= render(:partial => 'file', :locals => {
:project => @project,
:file => file,
:link => nil,
:id => file.id,
:name => 'files[]',
:title => file.title }) %>
</tr> </tr>
<% end %> <% end %>
<% @file_links.each do |link| %> <% @file_links.each do |link| %>
@ -154,7 +174,13 @@
<% next %> <% next %>
<% end %> <% end %>
<tr class="gray"> <tr class="gray">
<%= render(:partial => 'file', :locals => {:file => link.target_file, :link => link}) %> <%= render(:partial => 'file', :locals => {
:project => link.target_project,
:file => link.target_file,
:link => link,
:id => link.id,
:name => 'file_links[]',
:title => link.name }) %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@ -30,16 +30,20 @@
:title => l(:title_lock_file), :title => l(:title_lock_file),
:class => 'icon icon-dmsf-lock') %> :class => 'icon icon-dmsf-lock') %>
<% if @file.notification %> <% if @file.notification %>
<%= link_to(l(:label_notifications_off), <%= link_to(l(:label_notifications_off),
notify_deactivate_dmsf_files_path(:id => @file), notify_deactivate_dmsf_files_path(:id => @file),
:title => l(:title_notifications_active_deactivate), :title => l(:title_notifications_active_deactivate),
:class => 'icon icon-notification-on') %> :class => 'icon icon-notification-on') %>
<% else %> <% else %>
<%= link_to(l(:label_notifications_on), <%= link_to(l(:label_notifications_on),
notify_activate_dmsf_files_path(:id => @file), notify_activate_dmsf_files_path(:id => @file),
:title => l(:title_notifications_not_active_activate), :title => l(:title_notifications_not_active_activate),
:class => 'icon icon-notification-off') %> :class => 'icon icon-notification-off') %>
<% end %> <% end %>
<%= link_to(l(:label_link_to),
new_dmsf_link_path(:project_id => @project.id, :dmsf_folder_id => @file.folder ? @file.folder.id : nil, :dmsf_file_id => @file.id, :type => 'link_to'),
:title => l(:link_create_link),
:class => 'icon icon-link') %>
<%= link_to(l(:button_copy), copy_file_path(:id => @file), <%= link_to(l(:button_copy), copy_file_path(:id => @file),
:title => l(:title_copy), :class => 'icon icon-copy') %> :title => l(:title_copy), :class => 'icon icon-copy') %>
<%= delete_link @file %> <%= delete_link @file %>

View File

@ -1,6 +1,6 @@
<%# Redmine plugin for Document Management System "Features" <%# Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2014 Karel Pičman <karel.picman@lbcfree.net> # Copyright (C) 2011-14 Karel Pičman <karel.picman@lbcfree.net>
# #
# 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
@ -21,34 +21,59 @@
<div class="contextual"> <div class="contextual">
</div> </div>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @dmsf_link.folder, :filename => nil}) %> <% type = (@type || params[:dmsf_link].blank?) ? @type : params[:dmsf_link][:type] %>
<% dmsf_file_id = (@dmsf_file_id || params[:dmsf_link].blank?) ? @dmsf_file_id : params[:dmsf_link][:dmsf_file_id] %>
<% target_folder_id = (@target_folder_id || params[:dmsf_link].blank? || !DmsfLinksHelper.is_a_number?(params[:dmsf_link][:target_folder_id])) ? @target_folder_id : params[:dmsf_link][:target_folder_id].to_i %>
<% if dmsf_file_id %>
<% file = DmsfFile.find_by_id dmsf_file_id%>
<% title = file.title if file %>
<% end %>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @dmsf_link.folder, :filename => title}) %>
<%= labelled_form_for @dmsf_link do |f| %> <%= labelled_form_for @dmsf_link do |f| %>
<%= error_messages_for @dmsf_link %> <%= error_messages_for @dmsf_link %>
<%= f.hidden_field :project_id, :value => @dmsf_link.project_id %> <%= f.hidden_field :project_id, :value => @dmsf_link.project_id %>
<%= f.hidden_field :dmsf_folder_id, :value => @dmsf_link.dmsf_folder_id if @dmsf_link.dmsf_folder_id %> <%= f.hidden_field :dmsf_folder_id, :value => @dmsf_link.dmsf_folder_id if @dmsf_link.dmsf_folder_id %>
<%= f.hidden_field :type, :value => type %>
<%= f.hidden_field :dmsf_file_id, :value => dmsf_file_id %>
<div class="box dmsf_detail"> <div class="box dmsf_detail">
<p> <p>
<%= f.select(:target_project_id, <% if type == 'link_from' %>
<%= label_tag('dmsf_link[target_project_id]', l(:label_source_project), :class => 'required') %>
<% else %>
<%= label_tag('dmsf_link[target_project_id]', l(:label_target_project), :class => 'required') %>
<% end %>
<%= select_tag('dmsf_link[target_project_id]',
project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy, project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy,
:selected => @dmsf_link.target_project), :selected => @dmsf_link.target_project)) %>
{:required => true}) %>
</p>
<p>
<%= f.select(:target_folder_id,
folder_tree_options_for_select(DmsfFolder.directory_tree(@dmsf_link.target_project),
:selected => @target_folder_id),
{:required => true}) %>
</p>
<p>
<%= f.select(:target_file_id,
options_for_select(
DmsfFolder.file_list(
(@target_folder_id ? DmsfFolder.find(@target_folder_id).files : @dmsf_link.target_project.dmsf_files).visible),
@target_file_id)) %>
</p> </p>
<p> <p>
<%= f.text_field :name, :size => 40, :maxlength => 255, :required => true, :value => @dmsf_link.name %> <% if type == 'link_from' %>
<%= label_tag('dmsf_link[target_folder_id]', l(:label_source_folder)) %>
<% else %>
<%= label_tag('dmsf_link[target_folder_id]', l(:label_target_folder)) %>
<% end %>
<%= select_tag('dmsf_link[target_folder_id]',
folder_tree_options_for_select(DmsfFolder.directory_tree(@dmsf_link.target_project),
:selected => target_folder_id)) %>
</p>
<% if type == 'link_from' %>
<p>
<% if target_folder_id %>
<% folder = DmsfFolder.find_by_id target_folder_id %>
<% files = folder.files.visible if folder %>
<% else %>
<% files = @dmsf_link.target_project.dmsf_files.visible if @dmsf_link.target_project %>
<% end %>
<%= f.select(:target_file_id,
options_for_select(DmsfFolder.file_list(files), params[:dmsf_link].present? ? params[:dmsf_link][:target_file_id] : nil)) %>
</p>
<% end %>
<p>
<%= label_tag('dmsf_link[name]', l(:label_link_name), :class => 'required') %>
<%= text_field_tag 'dmsf_link[name]', @dmsf_link.name, :size => 40, :maxlength => 255 %>
</p> </p>
</div> </div>
<%= f.submit l(:button_create) %> <%= f.submit l(:button_create) %>
@ -56,9 +81,9 @@
<script type="text/javascript"> <script type="text/javascript">
$('#dmsf_link_target_project_id').change(function () { $('#dmsf_link_target_project_id').change(function () {
$('#content').load("<%= url_for(:action => 'new', :project_id => @project.id, :dmsf_folder_id => @dmsf_link.dmsf_folder_id, :reload => true) %>", $('#new_dmsf_link').serialize()); $('#content').load("<%= url_for(:action => 'new', :project_id => @project.id, :reload => true) %>", $('#new_dmsf_link').serialize());
}); });
$('#dmsf_link_target_folder_id').change(function () { $('#dmsf_link_target_folder_id').change(function () {
$('#content').load("<%= url_for(:action => 'new', :project_id => @project.id, :dmsf_folder_id => @dmsf_link.dmsf_folder_id) %>", $('#new_dmsf_link').serialize()); $('#content').load("<%= url_for(:action => 'new', :project_id => @project.id) %>", $('#new_dmsf_link').serialize());
}); });
</script> </script>

View File

@ -18,7 +18,7 @@
# 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.%>
<%= link_to @user, user_path(@user, :only_path => false) %> <%= l(:text_email_doc_deleted) %> <%= link_to User.current, user_path(User.current, :only_path => false) %> <%= l(:text_email_doc_deleted) %>
<%= link_to @project, project_path(@project, :only_path => false) %> <%= l(:text_email_doc_follows) %> <%= link_to @project, project_path(@project, :only_path => false) %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<p> <p>

View File

@ -18,7 +18,7 @@
# 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.%>
<%= @user.name %> <%= l(:text_email_doc_deleted) %> <%= @project.name %> <%= l(:text_email_doc_follows) %> <%= User.current.name %> <%= l(:text_email_doc_deleted) %> <%= @project.name %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<%= h(file.dmsf_path_str) %> (<%= file.name %>) <%= h(file.dmsf_path_str) %> (<%= file.name %>)
<% if file.last_revision %> <% if file.last_revision %>

View File

@ -18,7 +18,7 @@
# 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.%>
<%= link_to @user, user_path(@user, :only_path => false) %> <%= l(:text_email_doc_updated) %> <%= link_to User.current, user_path(User.current, :only_path => false) %> <%= l(:text_email_doc_updated) %>
<%= link_to @project, project_path(@project, :only_path => false) %> <%= l(:text_email_doc_follows) %> <%= link_to @project, project_path(@project, :only_path => false) %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<p> <p>

View File

@ -18,7 +18,7 @@
# 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.%>
<%= @user.name %> <%= l(:text_email_doc_updated) %> <%= User.current.name %> <%= l(:text_email_doc_updated) %>
<%= @project.name %> <%= l(:text_email_doc_follows) %> <%= @project.name %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<%= h(file.dmsf_path_str) %> (<%= file.name %>), <%= h(file.dmsf_path_str) %> (<%= file.name %>),

View File

@ -62,7 +62,7 @@
<%= link_to_project(file.project) %> <%= link_to_project(file.project) %>
</td> </td>
<td class="title"> <td class="title">
<%= link_to(h(file.last_revision.display_title), <%= link_to(h(file.title),
{:controller => 'dmsf_files', :action => :show, :id => file }, {:controller => 'dmsf_files', :action => :show, :id => file },
:class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}") %> :class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}") %>
</td> </td>

View File

@ -55,7 +55,7 @@
</td> </td>
<td class="title"> <td class="title">
<% if assignment.dmsf_file_revision && assignment.dmsf_file_revision.file %> <% if assignment.dmsf_file_revision && assignment.dmsf_file_revision.file %>
<%= link_to(h(assignment.dmsf_file_revision.display_title), <%= link_to(h(assignment.dmsf_file_revision.title),
{:controller => 'dmsf_files', :action => :show, :id => assignment.dmsf_file_revision.file }) %> {:controller => 'dmsf_files', :action => :show, :id => assignment.dmsf_file_revision.file }) %>
<% end %> <% end %>
</td> </td>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

View File

@ -323,10 +323,14 @@ tr.gray .icon-folder { background-image: url(../images/folder_gray.png); }
.icon-file.filetype-odp { background-image: url(../images/filetypes/odp.png); } .icon-file.filetype-odp { background-image: url(../images/filetypes/odp.png); }
.icon-file.filetype-odg { background-image: url(../images/filetypes/odg.png); } .icon-file.filetype-odg { background-image: url(../images/filetypes/odg.png); }
tr.gray .icon-file.filetype-doc, .icon-file.filetype-docx { background-image: url(../images/filetypes/doc_gray.png); } tr.gray .icon-file.filetype-doc { background-image: url(../images/filetypes/doc_gray.png); }
tr.gray .icon-file.filetype-xls, .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls_gray.png); } tr.gray .icon-file.filetype-docx { background-image: url(../images/filetypes/doc_gray.png); }
tr.gray .icon-file.filetype-ppt, .icon-file.filetype-pptx { background-image: url(../images/filetypes/ppt_gray.png); } tr.gray .icon-file.filetype-xls { background-image: url(../images/filetypes/xls_gray.png); }
tr.gray .icon-file.filetype-vsd, .icon-file.filetype-vsdx { background-image: url(../images/filetypes/vsd_gray.png); } tr.gray .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls_gray.png); }
tr.gray .icon-file.filetype-ppt { background-image: url(../images/filetypes/ppt_gray.png); }
tr.gray .icon-file.filetype-pptx { background-image: url(../images/filetypes/ppt_gray.png); }
tr.gray .icon-file.filetype-vsd { background-image: url(../images/filetypes/vsd_gray.png); }
tr.gray .icon-file.filetype-vsdx { background-image: url(../images/filetypes/vsd_gray.png); }
tr.gray .icon-file.filetype-mpp { background-image: url(../images/filetypes/mpp_gray.png); } tr.gray .icon-file.filetype-mpp { background-image: url(../images/filetypes/mpp_gray.png); }
tr.gray .icon-file.filetype-odt { background-image: url(../images/filetypes/odt_gray.png); } tr.gray .icon-file.filetype-odt { background-image: url(../images/filetypes/odt_gray.png); }
tr.gray .icon-file.filetype-ods { background-image: url(../images/filetypes/ods_gray.png); } tr.gray .icon-file.filetype-ods { background-image: url(../images/filetypes/ods_gray.png); }
@ -352,4 +356,9 @@ tr.gray .icon-file.application-x-gzip { background-image: url(../images/filetype
/* Links */ /* Links */
.gray { color: #AAA } .gray { color: #AAA }
.gray a, .gray a:link, .gray a:visited{ color: #484848; text-decoration: none; } .gray a, .gray a:link, .gray a:visited{ color: #484848; text-decoration: none; }
label.required:after {
content: " *";
color: #bb0000;
}

View File

@ -1,7 +1,8 @@
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2013 Karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-14 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
@ -191,8 +192,8 @@ cs:
title_copy: Kopírovat title_copy: Kopírovat
error_folder_cannot_be_copied: Složka nemůže být zkopírována error_folder_cannot_be_copied: Složka nemůže být zkopírována
notice_folder_copied: Složka zkopírována notice_folder_copied: Složka zkopírována
error_max_email_filesize_exceeded: "Přesáhli jste maximální velikost souboru, který lze poslat emailem. (%{number} MB)"
error_max_email_filesize_exceeded: "Přesáhli jste maximální velikost souboru, který lze poslat emailem. (%{number} MB)"
note_maximum_email_filesize: Omezí se maximální velikost souboru, který může být poslán emailem. 0 znamená neomezený. Číslo je v MB. note_maximum_email_filesize: Omezí se maximální velikost souboru, který může být poslán emailem. 0 znamená neomezený. Číslo je v MB.
label_maximum_email_filesize: Maximální velikost souboru emailu label_maximum_email_filesize: Maximální velikost souboru emailu
header_minimum_filesize: Chyba souboru. header_minimum_filesize: Chyba souboru.
@ -271,13 +272,21 @@ cs:
text_email_to_proceed: Pro schválení klikněte na zaškrtávací ikonku vedle dokumentu v text_email_to_proceed: Pro schválení klikněte na zaškrtávací ikonku vedle dokumentu v
text_email_to_see_history: Pro zobrazení historie schvalovacího procesu klikněte na status dokumentu v text_email_to_see_history: Pro zobrazení historie schvalovacího procesu klikněte na status dokumentu v
text_email_to_see_status: Pro zobrazení aktuálního stavu schvalovacího procesu klikněte na status dokumentu v text_email_to_see_status: Pro zobrazení aktuálního stavu schvalovacího procesu klikněte na status dokumentu v
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Vytvořit symbolický odkaz title_create_link: Vytvořit symbolický odkaz
label_create_link: Vytvořit odkaz label_link_from: Odkaz z
label_link_to: Odkaz do
label_notifications_on: Zapnout notifikace label_notifications_on: Zapnout notifikace
label_notifications_off: Vypnout notifikace label_notifications_off: Vypnout notifikace
field_target_file: Cílový soubor field_target_file: Zdrojový soubor
title_download_entries: Historie stahování title_download_entries: Historie stahování
label_link_name: Název odkazu
label_target_folder: Cílový adresář
label_source_folder: Zdrojový adresář
label_target_project: Cílový projekt
label_source_project: Zdrojový projekt
text_email_doc_updated_subject: "Dokumenty projektu %{project} aktualizovány" text_email_doc_updated_subject: "Dokumenty projektu %{project} aktualizovány"
text_email_doc_updated: právě aktualizoval dokumenty projektu text_email_doc_updated: právě aktualizoval dokumenty projektu

View File

@ -1,7 +1,8 @@
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Terrence Miller # Copyright (C) 2011 Terrence Miller
# Copyright (C) 2013 Christian Wetting <christian.wetting@kontron.com> # Copyright (C) 2013 Christian Wetting <christian.wetting@kontron.com>
# Copyright (C) 2011-14 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
@ -36,6 +37,7 @@ de:
error_folder_is_not_empty: Ordner ist nicht leer error_folder_is_not_empty: Ordner ist nicht leer
error_folder_title_is_already_used: Titel wird schon benutzt. Denk dir was Neues aus. error_folder_title_is_already_used: Titel wird schon benutzt. Denk dir was Neues aus.
notice_folder_details_were_saved: Ordnerdetails wurden gespeichert notice_folder_details_were_saved: Ordnerdetails wurden gespeichert
error_folder_is_locked: Order ist gesperrt
error_file_is_locked: Datei ist gesperrt error_file_is_locked: Datei ist gesperrt
notice_file_deleted: Datei gelöscht notice_file_deleted: Datei gelöscht
error_at_least_one_revision_must_be_present: Es muss mindestens eine Version existieren error_at_least_one_revision_must_be_present: Es muss mindestens eine Version existieren
@ -214,9 +216,7 @@ de:
select_option_webdav_readonly: nur Lesen select_option_webdav_readonly: nur Lesen
select_option_webdav_readwrite: Lesen/Schreiben select_option_webdav_readwrite: Lesen/Schreiben
label_webdav_strategy: Webdav Strategie label_webdav_strategy: Webdav Strategie
note_webdav_strategy: Erlaubt dem Administrator den Wechsel der WebDav Nutzung zwischen nur lesend und auch schreibenden Zugriffen. note_webdav_strategy: Erlaubt dem Administrator den Wechsel der WebDav Nutzung zwischen nur lesend und auch schreibenden Zugriffen.
# Not translated
error_unable_delete_dmsf_workflow: Unable to delete the workflow error_unable_delete_dmsf_workflow: Unable to delete the workflow
error_empty_note: The note can't be empty error_empty_note: The note can't be empty
@ -238,7 +238,7 @@ de:
label_dmsf_wokflow_action_assign: Assign an approval workflow label_dmsf_wokflow_action_assign: Assign an approval workflow
label_dmsf_wokflow_action_start: Start workflow label_dmsf_wokflow_action_start: Start workflow
label_dmsf_workflow_add_approver: "Add a new approver with a logical function:" label_dmsf_workflow_add_approver: "Add a new approver with a logical function:"
label_or: or label_or: oder
label_action: Action label_action: Action
label_note: Note label_note: Note
title_none: None title_none: None
@ -272,13 +272,27 @@ de:
text_email_to_proceed: To proceed click on the check box icon next to the document in text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in text_email_to_see_history: To see the approval history click on the workflow status of the document in
text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of
text_email_doc_follows: as follows
text_email_doc_deleted_subject: "Documents of %{project} deleted"
text_email_doc_deleted: has just deleted documents of
label_links_only: links only label_links_only: links only
my: my:

View File

@ -1,8 +1,8 @@
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk> # Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2013 karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-14 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
@ -110,8 +110,7 @@ en:
label_created: Created label_created: Created
label_changed: Changed label_changed: Changed
info_changed_by_user: "%{changed} by" info_changed_by_user: "%{changed} by"
label_filename: Filename label_filename: Filename
label_approval_workflow: Workflow
label_mime: Mime label_mime: Mime
label_size: Size label_size: Size
heading_new_revision: New Revision heading_new_revision: New Revision
@ -277,11 +276,17 @@ en:
label_my_locked_documents: My locked documents label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of
@ -296,4 +301,4 @@ en:
openap_provals: Open approvals openap_provals: Open approvals
label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX
note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB.

View File

@ -2,6 +2,8 @@
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.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
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
@ -51,9 +53,7 @@ es:
warning_file_notifications_already_activated: Las notificaciones del archivo seleccionado ya estaban activadas previamente warning_file_notifications_already_activated: Las notificaciones del archivo seleccionado ya estaban activadas previamente
notice_file_notifications_activated: Notificación de archivo activado notice_file_notifications_activated: Notificación de archivo activado
warning_file_notifications_already_deactivated: Las notificaciones del archivo seleccionado ya estaban desactivadas previamente warning_file_notifications_already_deactivated: Las notificaciones del archivo seleccionado ya estaban desactivadas previamente
notice_file_notifications_deactivated: Notificación de archivo desactivada notice_file_notifications_deactivated: Notificación de archivo desactivada
# Not translated
link_details: "%{title} details" link_details: "%{title} details"
link_edit: "Edit %{title}" link_edit: "Edit %{title}"
submit_create: Create submit_create: Create
@ -272,13 +272,21 @@ es:
text_email_to_proceed: To proceed click on the check box icon next to the document in text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in text_email_to_see_history: To see the approval history click on the workflow status of the document in
text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of
@ -291,7 +299,6 @@ es:
blocks: blocks:
locked_documents: Locked documents locked_documents: Locked documents
open_approvals: Open approvals open_approvals: Open approvals
label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX
note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB.

View File

@ -2,7 +2,7 @@
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk> # Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2013 karel Pičman <karel.picman@kontron.com> # Copyright (C) 2014 Atmis
# #
# 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
@ -110,8 +110,7 @@ fr:
label_created: Créé label_created: Créé
label_changed: Modifié label_changed: Modifié
info_changed_by_user: "%{changed} par" info_changed_by_user: "%{changed} par"
label_filename: Fichier label_filename: Fichier
label_approval_workflow: Flux de validation
label_mime: Type label_mime: Type
label_size: Taille label_size: Taille
heading_new_revision: Nouvelle révision heading_new_revision: Nouvelle révision
@ -277,11 +276,17 @@ fr:
label_my_locked_documents: Mes documents verrouillés label_my_locked_documents: Mes documents verrouillés
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of
@ -296,4 +301,4 @@ fr:
open_approvals: Approbations en attente open_approvals: Approbations en attente
label_maximum_ajax_upload_filesize: Taille maximale de fichier pour téléversement via AJAX label_maximum_ajax_upload_filesize: Taille maximale de fichier pour téléversement via AJAX
note_maximum_ajax_upload_filesize: "Taille maximale, en méga octets, de fichier pour téléversement via l'interface standard AJAX. Sinon l'interface standard de Redmine doit être utilisée." note_maximum_ajax_upload_filesize: "Taille maximale, en méga octets, de fichier pour téléversement via l'interface standard AJAX. Sinon l'interface standard de Redmine doit être utilisée."

View File

@ -2,6 +2,8 @@
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.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
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
@ -189,9 +191,7 @@ ja:
warning_no_project_to_copy_folder_to: フォルダをコピーするプロジェクトがありません warning_no_project_to_copy_folder_to: フォルダをコピーするプロジェクトがありません
title_copy: コピー title_copy: コピー
error_folder_cannot_be_copied: フォルダをコピーできません error_folder_cannot_be_copied: フォルダをコピーできません
notice_folder_copied: フォルダをコピーしました notice_folder_copied: フォルダをコピーしました
# Not translated
error_max_email_filesize_exceeded: "You've exceeded the maximum filesize for sending via email. (%{number} MB)" error_max_email_filesize_exceeded: "You've exceeded the maximum filesize for sending via email. (%{number} MB)"
note_maximum_email_filesize: "Limits maximum filesize that can be sent via email. 0 means unlimited. Number is in MB." note_maximum_email_filesize: "Limits maximum filesize that can be sent via email. 0 means unlimited. Number is in MB."
@ -272,13 +272,21 @@ ja:
text_email_to_proceed: To proceed click on the check box icon next to the document in text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in text_email_to_see_history: To see the approval history click on the workflow status of the document in
text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of

View File

@ -2,6 +2,8 @@
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.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
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
@ -215,9 +217,7 @@ ru:
select_option_webdav_readwrite: "Чтение/Запись" select_option_webdav_readwrite: "Чтение/Запись"
label_webdav_strategy: "Стратегия WebDAV" label_webdav_strategy: "Стратегия WebDAV"
note_webdav_strategy: "Позволяет администратору решить в каком режиме предоставить доступ к WebDAV для конечных пользователей (Только для чтения или Чтение+Запись)." note_webdav_strategy: "Позволяет администратору решить в каком режиме предоставить доступ к WebDAV для конечных пользователей (Только для чтения или Чтение+Запись)."
# Not translated
error_unable_delete_dmsf_workflow: Unable to delete the workflow error_unable_delete_dmsf_workflow: Unable to delete the workflow
error_empty_note: The note can't be empty error_empty_note: The note can't be empty
error_workflow_assign: An error occured while assigning error_workflow_assign: An error occured while assigning
@ -272,13 +272,21 @@ ru:
text_email_to_proceed: To proceed click on the check box icon next to the document in text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in text_email_to_see_history: To see the approval history click on the workflow status of the document in
text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of

View File

@ -2,6 +2,8 @@
# #
# Copyright (C) 2011 <zdravko.balorda@mks.si> # Copyright (C) 2011 <zdravko.balorda@mks.si>
# #
#
#
# 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
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
@ -173,8 +175,7 @@ sl:
heading_access_last: Zadnji heading_access_last: Zadnji
label_dmsf_updated: Arhiv posodobljen label_dmsf_updated: Arhiv posodobljen
title_total_size_of_all_files: Skupna velikost vseh datotek v tej mapi title_total_size_of_all_files: Skupna velikost vseh datotek v tej mapi
project_module_dmsf: Arhiv project_module_dmsf: Arhiv
warning_no_project_to_copy_file_to: Ni projekta kamor bi kopiral datoteko warning_no_project_to_copy_file_to: Ni projekta kamor bi kopiral datoteko
comment_copied_from: "Skopirano iz %{source}" comment_copied_from: "Skopirano iz %{source}"
notice_file_copied: Datoteka skopirana notice_file_copied: Datoteka skopirana
@ -216,8 +217,7 @@ sl:
select_option_webdav_readwrite: "Beri/Piši" select_option_webdav_readwrite: "Beri/Piši"
label_webdav_strategy: Webdav strategija label_webdav_strategy: Webdav strategija
note_webdav_strategy: "Omogoči administratorju da odloči ali je webdav platforma na voljo izključno za branje ali beri/piši za končne uporabnike." note_webdav_strategy: "Omogoči administratorju da odloči ali je webdav platforma na voljo izključno za branje ali beri/piši za končne uporabnike."
# Not translated
error_unable_delete_dmsf_workflow: Unable to delete the workflow error_unable_delete_dmsf_workflow: Unable to delete the workflow
error_empty_note: "The note can't be empty" error_empty_note: "The note can't be empty"
error_workflow_assign: An error occured while assigning error_workflow_assign: An error occured while assigning
@ -272,13 +272,21 @@ sl:
text_email_to_proceed: To proceed click on the check box icon next to the document in text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in text_email_to_see_history: To see the approval history click on the workflow status of the document in
text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of

View File

@ -2,6 +2,8 @@
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.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
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
@ -173,10 +175,7 @@ zh:
heading_access_last: 末次 heading_access_last: 末次
label_dmsf_updated: DMSF updated label_dmsf_updated: DMSF updated
title_total_size_of_all_files: 文件夹所有文件总大小 title_total_size_of_all_files: 文件夹所有文件总大小
project_module_dmsf: 文档管家 project_module_dmsf: 文档管家
# Not translated
warning_no_project_to_copy_file_to: No project to copy file to warning_no_project_to_copy_file_to: No project to copy file to
comment_copied_from: "Copied from %{source}" comment_copied_from: "Copied from %{source}"
notice_file_copied: File copied notice_file_copied: File copied
@ -273,13 +272,21 @@ zh:
text_email_to_proceed: To proceed click on the check box icon next to the document in text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in text_email_to_see_history: To see the approval history click on the workflow status of the document in
text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in text_email_to_see_status: To see the current status of the approval workflow click on the workflow status the document in
label_my_open_approvals: My open approvals
label_my_locked_documents: My locked documents
title_create_link: Create a symbolic link title_create_link: Create a symbolic link
label_create_link: Create link label_link_from: Link from
label_link_to: Link to
label_notifications_on: Notifications on label_notifications_on: Notifications on
label_notifications_off: Notifications off label_notifications_off: Notifications off
field_target_file: Target file field_target_file: Source file
title_download_entries: Download entries title_download_entries: Download entries
label_link_name: Link name
label_target_folder: Target folder
label_source_folder: Source folder
label_target_project: Target project
label_source_project: Source project
text_email_doc_updated_subject: "Documents of %{project} updated" text_email_doc_updated_subject: "Documents of %{project} updated"
text_email_doc_updated: has just actualized documents of text_email_doc_updated: has just actualized documents of

View File

@ -46,3 +46,11 @@ dmsf_files_005:
deleted: 0 deleted: 0
deleted_by_user_id: NULL deleted_by_user_id: NULL
dmsf_files_006:
id: 6
project_id: 2
dmsf_folder_id: 3
name: "test.txt"
notification: 0
deleted: 0
deleted_by_user_id: NULL

View File

@ -25,49 +25,69 @@ class DmsfLinksControllerTest < RedmineDmsf::Test::TestCase
def setup def setup
@user_admin = User.find_by_id 1 @user_admin = User.find_by_id 1
@user_member = User.find_by_id 2 @user_member = User.find_by_id 2
@user_non_member = User.find_by_id 3 assert_not_nil @user_member
@project1 = Project.find_by_id 1 @user_non_member = User.find_by_id 3
assert_not_nil @project1
@project1.enable_module! :dmsf
@role_manager = Role.where(:name => 'Manager').first @role_manager = Role.where(:name => 'Manager').first
assert_not_nil @role_manager assert_not_nil @role_manager
@role_manager.add_permission! :file_manipulation @role_manager.add_permission! :file_manipulation
@folder1 = DmsfFolder.find_by_id 1 @role_developer = Role.where(:name => 'Developer').first
@file1 = DmsfFile.find_by_id 1 assert_not_nil @role_developer
@role_developer.add_permission! :file_manipulation
@project1 = Project.find_by_id 1
assert_not_nil @project1
@project1.enable_module! :dmsf
@project2 = Project.find_by_id 2
assert_not_nil @project2
@project2.enable_module! :dmsf
@folder1 = DmsfFolder.find_by_id 1 # project1/folder1
@folder2 = DmsfFolder.find_by_id 2 # project1/folder1/folder2
@folder3 = DmsfFolder.find_by_id 3 # project2/folder3
@file1 = DmsfFile.find_by_id 1 # project1/file1
@file2 = DmsfFile.find_by_id 2 # project2/file2
@file4 = DmsfFile.find_by_id 4 # project1/folder2/file4
@file6 = DmsfFile.find_by_id 6 # project2/folder3/file6
@request.session[:user_id] = @user_member.id @request.session[:user_id] = @user_member.id
@file_link = DmsfLink.find_by_id 1 @file_link = DmsfLink.find_by_id 1
@request.env['HTTP_REFERER'] = dmsf_folder_path(:id => @project1.id, :folder_id => @folder1.id) @request.env['HTTP_REFERER'] = dmsf_folder_path(:id => @project1.id, :folder_id => @folder1.id)
end end
def test_truth def test_truth
assert_kind_of User, @user_admin assert_kind_of User, @user_admin
assert_kind_of User, @user_member assert_kind_of User, @user_member
assert_kind_of User, @user_non_member assert_kind_of User, @user_non_member
assert_kind_of Project, @project1 assert_kind_of Project, @project1
assert_kind_of Project, @project2
assert_kind_of Role, @role_manager assert_kind_of Role, @role_manager
assert_kind_of Role, @role_developer
assert_kind_of DmsfFolder, @folder1 assert_kind_of DmsfFolder, @folder1
assert_kind_of DmsfFolder, @folder2
assert_kind_of DmsfFolder, @folder3
assert_kind_of DmsfFile, @file1 assert_kind_of DmsfFile, @file1
assert_kind_of DmsfFile, @file2
assert_kind_of DmsfFile, @file4
assert_kind_of DmsfFile, @file6
assert_kind_of DmsfLink, @file_link assert_kind_of DmsfLink, @file_link
end end
def test_authorize def test_authorize_admin
# Admin
@request.session[:user_id] = @user_admin.id @request.session[:user_id] = @user_admin.id
get :new, :project_id => @project1.id get :new, :project_id => @project1.id
assert_response :success assert_response :success
assert_template 'new' assert_template 'new'
end
# Non member def test_authorize_non_member
@request.session[:user_id] = @user_non_member.id @request.session[:user_id] = @user_non_member.id
get :new, :project_id => @project1.id get :new, :project_id => @project2.id
assert_response :forbidden assert_response :forbidden
end
# Member def test_authorize_member
@request.session[:user_id] = @user_member.id @request.session[:user_id] = @user_member.id
get :new, :project_id => @project1.id get :new, :project_id => @project1.id
assert_response :success assert_response :success
# Without the module # Without the module
@project1.disable_module!(:dmsf) @project1.disable_module!(:dmsf)
get :new, :project_id => @project1.id get :new, :project_id => @project1.id
@ -85,17 +105,190 @@ class DmsfLinksControllerTest < RedmineDmsf::Test::TestCase
assert_response :success assert_response :success
end end
def test_create def test_create_file_link_from
# 1. File link in a folder from another folder
assert_difference 'DmsfLink.count', +1 do assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => { post :create, :dmsf_link => {
:project_id => @project1.id, :project_id => @project1.id,
:target_project_id => @project1.id, :target_project_id => @project2.id,
:dmsf_folder_id => @folder1.id, :dmsf_folder_id => @folder1.id,
:target_file_id => @file1.id, :target_file_id => @file6.id,
:name => 'file_link' :target_folder_id => @folder3.id,
} :name => 'file_link',
:type => 'link_from'
}
end end
assert_redirected_to dmsf_folder_path(:id => @project1.id, :folder_id => @folder1.id) assert_redirected_to dmsf_folder_path(:id => @project1.id, :folder_id => @folder1.id)
# 2. File link in a folder from another root folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:dmsf_folder_id => @folder1.id,
:target_project_id => @project2.id,
:target_file_id => @file2.id,
:target_folder_id => 'Documents',
:name => 'file_link',
:type => 'link_from'
}
end
assert_redirected_to dmsf_folder_path(:id => @project1.id, :folder_id => @folder1.id)
# 3. File link in a root folder from another folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:target_project_id => @project2.id,
:target_file_id => @file6.id,
:target_folder_id => @folder3.id,
:name => 'file_link',
:type => 'link_from'
}
end
assert_redirected_to dmsf_folder_path(:id => @project1.id)
# 4. File link in a root folder from another root folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:target_project_id => @project2.id,
:target_file_id => @file2.id,
:name => 'file_link',
:type => 'link_from'
}
end
assert_redirected_to dmsf_folder_path(:id => @project1.id)
end
def test_create_folder_link_from
# 1. Folder link in a folder from another folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:dmsf_folder_id => @folder1.id,
:target_project_id => @project2.id,
:target_folder_id => @folder3.id,
:name => 'folder_link',
:type => 'link_from'
}
end
assert_redirected_to dmsf_folder_path(:id => @project1.id, :folder_id => @folder1.id)
# 2. Folder link in a folder from another root folder
assert_difference 'DmsfLink.count', +0 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:dmsf_folder_id => @folder1.id,
:target_project_id => @project2.id,
:name => 'folder_link',
:type => 'link_from'
}
end
assert_response :success
# 3. Folder link in a root folder from another folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:target_project_id => @project2.id,
:target_folder_id => @folder3.id,
:name => 'folder_link',
:type => 'link_from'
}
end
assert_redirected_to dmsf_folder_path(:id => @project1.id)
# 4. Folder link in a root folder from another root folder
assert_difference 'DmsfLink.count', +0 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:target_project_id => @project2.id,
:name => 'folder_link',
:type => 'link_from'
}
end
assert_response :success
end
def test_create_file_link_to
# 1. File link to a root folder from another folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:dmsf_file_id => @file1.id,
:target_project_id => @project2.id,
:target_folder_id => @folder3.id,
:name => 'file_link',
:type => 'link_to'
}
end
assert_redirected_to dmsf_file_path(@file1)
# 2. File link to a folder from another folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project2.id,
:dmsf_folder_id => @folder3.id,
:target_project_id => @project1.id,
:target_folder_id => @folder1.id,
:dmsf_file_id => @file6.id,
:name => 'file_link',
:type => 'link_to'
}
end
assert_redirected_to dmsf_file_path(@file6)
# 3. File link to a root folder from another root folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project2.id,
:target_project_id => @project1.id,
:dmsf_file_id => @file6.id,
:name => 'file_link',
:type => 'link_to'
}
end
assert_redirected_to dmsf_file_path(@file6)
# 4. File link to a folder from another root folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project2.id,
:dmsf_folder_id => @folder3.id,
:target_project_id => @project1.id,
:dmsf_file_id => @file6.id,
:name => 'file_link',
:type => 'link_to'
}
end
assert_redirected_to dmsf_file_path(@file6)
end
def test_create_folder_link_to
# 1. Folder link to a root folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:dmsf_folder_id => @folder1.id,
:target_project_id => @project2.id,
:name => 'folder_link',
:type => 'link_to'
}
end
assert_redirected_to edit_dmsf_path(:id => @project1.id, :folder_id => @folder1.id)
# 2. Folder link to a folder
assert_difference 'DmsfLink.count', +1 do
post :create, :dmsf_link => {
:project_id => @project1.id,
:dmsf_folder_id => @folder1.id,
:target_project_id => @project2.id,
:target_folder_id => @folder3.id,
:name => 'folder_link',
:type => 'link_to'
}
end
assert_redirected_to edit_dmsf_path(:id => @project1.id, :folder_id => @folder1.id)
end end
def test_destroy def test_destroy