Merge pull request #158 from picman/master

Picman's fork
This commit is contained in:
Karel Picman 2013-09-25 04:32:54 -07:00
commit 9e6eb72a94
33 changed files with 250 additions and 234 deletions

View File

@ -75,7 +75,7 @@ class DmsfController < ApplicationController
DmsfMailer.send_documents(User.current, @email_params["to"], @email_params["cc"],
@email_params["subject"], @email_params["zipped_content"], @email_params["body"]).deliver
File.delete(@email_params["zipped_content"])
flash[:notice] = l(:notice_email_sent)
flash[:notice] = l(:notice_email_sent, @email_params["to"])
redirect_to({:controller => "dmsf", :action => "show", :id => @project, :folder_id => @folder})
end
@ -203,26 +203,46 @@ class DmsfController < ApplicationController
redirect_to :controller => "dmsf", :action => "show", :id => @project
end
def notify_activate
if @folder.notification
def notify_activate
if((@folder && @folder.notification) || (@folder.nil? && @project.dmsf_notification))
flash[:warning] = l(:warning_folder_notifications_already_activated)
else
@folder.notify_activate
if @folder
@folder.notify_activate
else
@project.dmsf_notification = true
@project.save
end
flash[:notice] = l(:notice_folder_notifications_activated)
end
redirect_to params[:current] ? params[:current] :
{:controller => "dmsf", :action => "show", :id => @project, :folder_id => @folder.folder}
if params[:current]
redirect_to params[:current]
elsif @folder
redirect_to({:controller => 'dmsf', :action => 'show', :id => @project, :folder_id => @folder.folder})
else
redirect_to({:controller => 'dmsf', :action => 'show', :id => @project})
end
end
def notify_deactivate
if !@folder.notification
if((@folder && !@folder.notification) || (@folder.nil? && !@project.dmsf_notification))
flash[:warning] = l(:warning_folder_notifications_already_deactivated)
else
@folder.notify_deactivate
if @folder
@folder.notify_deactivate
else
@project.dmsf_notification = false
@project.save
end
flash[:notice] = l(:notice_folder_notifications_deactivated)
end
redirect_to params[:current] ? params[:current] :
{:controller => "dmsf", :action => "show", :id => @project, :folder_id => @folder.folder}
if params[:current]
redirect_to params[:current]
elsif @folder
redirect_to({:controller => 'dmsf', :action => 'show', :id => @project, :folder_id => @folder.folder})
else
redirect_to({:controller => 'dmsf', :action => 'show', :id => @project})
end
end

View File

@ -49,7 +49,11 @@ class DmsfFilesController < ApplicationController
end
end
check_project(@revision.file)
send_revision
begin
send_revision
rescue ActionController::MissingFile => e
render_404
end
return
end
@ -125,7 +129,7 @@ class DmsfFilesController < ApplicationController
begin
DmsfMailer.files_updated(User.current, [@file]).deliver
rescue ActionView::MissingTemplate => e
Rails.logger.error "Could not send email notifications: " + e
Rails.logger.error "Could not send email notifications: #{e.message}"
end
redirect_to :action => "show", :id => @file
else

View File

@ -72,7 +72,7 @@ class DmsfFilesCopyController < ApplicationController
begin
DmsfMailer.files_updated(User.current, [new_file]).deliver
rescue ActionView::MissingTemplate => e
Rails.logger.error "Could not send email notifications: " + e
Rails.logger.error "Could not send email notifications: #{e.message}"
end
redirect_to :controller => "dmsf_files", :action => "show", :id => new_file
@ -110,7 +110,7 @@ class DmsfFilesCopyController < ApplicationController
# TODO: implement proper mail notification
DmsfMailer.files_updated(User.current, [@file]).deliver
rescue ActionView::MissingTemplate => e
Rails.logger.error "Could not send email notifications: " + e
Rails.logger.error "Could not send email notifications: #{e.message}"
end
redirect_to :controller => "dmsf_files", :action => "show", :id => @file

View File

@ -121,8 +121,7 @@ class DmsfUploadController < ApplicationController
new_revision.title = commited_file["title"]
new_revision.description = commited_file["description"]
new_revision.comment = commited_file["comment"]
new_revision.increase_version(commited_file["version"].to_i, true)
#new_revision.set_workflow(commited_file[:dmsf_workflow_id], nil)
new_revision.increase_version(commited_file["version"].to_i, true)
new_revision.mime_type = Redmine::MimeType.of(new_revision.name)
new_revision.size = File.size(commited_disk_filepath)
@ -134,8 +133,13 @@ class DmsfUploadController < ApplicationController
end
if file.locked?
file.unlock!
flash[:notice] = l(:notice_file_unlocked)
begin
file.unlock!
flash[:notice] = l(:notice_file_unlocked)
rescue DmsfLockError => e
flash[:error] = e.message
next
end
end
# Need to save file first to generate id for it in case of creation.

View File

@ -125,23 +125,23 @@ class DmsfFile < ActiveRecord::Base
end
def title
self.last_revision.title
self.last_revision ? self.last_revision.title : self.name
end
def description
self.last_revision.description
self.last_revision ? self.last_revision.description : ''
end
def version
self.last_revision.version
self.last_revision ? self.last_revision.version : '0'
end
def workflow
self.last_revision.workflow
self.last_revision ? self.last_revision.workflow : nil
end
def size
self.last_revision.size
self.last_revision ? self.last_revision.size : 0
end
def dmsf_path
@ -150,15 +150,14 @@ class DmsfFile < ActiveRecord::Base
path
end
def dmsf_path_str
path = self.dmsf_path
string_path = path.map { |element| element.title }
string_path.join("/")
def dmsf_path_str
self.dmsf_path.map { |element| element.title }.join('/')
end
def notify?
return true if self.notification
return true if folder && folder.notify?
return true if !folder && self.project.dmsf_notification
return false
end

View File

@ -115,6 +115,7 @@ class DmsfFolder < ActiveRecord::Base
def notify?
return true if self.notification
return true if folder && folder.notify?
return true if !folder && self.project.dmsf_notification
return false
end

View File

@ -1,8 +0,0 @@
<%= link_to(l(:link_documents), {:controller => "dmsf", :action => "show", :id=> @project }) %>
<% path.each do |path_element| %>
/
<%= link_to(h(path_element.title), {:controller => "dmsf", :action => "show", :id=> @project, :folder_id => path_element}) %>
<% if path_element.notification %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) %>
<% end %>
<% end %>

View File

@ -7,9 +7,15 @@
<%
create = @pathfolder == @parent
%>
<h2>
<%= render(:partial => "path", :locals => {:path => @pathfolder.nil? ? [] : @pathfolder.dmsf_path}) %>
<%= ("/ " + l(:heading_new_folder)) if create %>
<h2>
<% path = @pathfolder ? @pathfolder.dmsf_path : [] %>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
<%= "/ #{l(:heading_new_folder)}" if create %>
</h2>
<%= form_for(@folder, :url => {:action => create ? "create" : "save", :id => @project, :folder_id => @folder, :parent_id => @parent},

View File

@ -3,23 +3,25 @@
<div class="contextual">
</div>
<h2><%= render(:partial => "path", :locals => {:path => []}) %></h2>
<h2>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id => @project } %>
</h2>
<%= form_for(@project, :url => {:action => "save_root", :id => @project},
:html => {:method=>:post}) do |f| %>
<div class="box dmsf_detail">
<p class="no-ident">
<%= label_tag("project_dmsf_description", l(:label_description) + ":") %>
</p>
<div class="wiki data clear">
<%= f.text_area(:dmsf_description, :rows => 15, :class => "wiki-edit") %>
</div>
</div>
<%= submit_tag(l(:submit_save)) %>
<%= form_for(@project, :url => {:action => 'save_root', :id => @project},
:html => {:method=>:post}) do |f| %>
<div class="box dmsf_detail">
<p class="no-ident">
<%= label_tag('project_dmsf_description', "#{l(:label_description)}:") %>
</p>
<div class="wiki data clear">
<%= f.text_area(:dmsf_description, :rows => 15, :class => 'wiki-edit') %>
</div>
</div>
<%= submit_tag(l(:submit_save)) %>
<% end %>
<%= wikitoolbar_for "dmsf_folder_description" %>
<%= wikitoolbar_for 'dmsf_folder_description' %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %>
<%= stylesheet_link_tag 'dmsf', :plugin => 'redmine_dmsf' %>
<% end %>

View File

@ -3,9 +3,13 @@
<div class="contextual">
</div>
<% path = @folder.nil? ? [] : @folder.dmsf_path %>
<h2>
<%= render(:partial => 'path', :locals => {:path => path}) %>
<h2>
<% path = @folder ? @folder.dmsf_path : [] %>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
</h2>
<h3><%= l(:heading_send_documents_by_email) %></h3>

View File

@ -1,40 +1,56 @@
<% html_title(l(:dmsf)) %>
<div class="contextual">
<% if User.current.allowed_to?(:folder_manipulation, @project) %>
<% if !@folder.nil? && (!@folder.locked_for_user? || User.current.allowed_to?(:force_file_unlock, @project)) %>
<% if @folder.locked? %>
<% unless @folder.unlockable? %>
<%= image_tag("locked.png", :plugin => :redmine_dmsf, :title => l(:title_folder_parent_locked, :name => @folder.folder.lock.reverse[0].folder.title)) unless @folder.nil?%>
<% else %>
<%= link_to_function(image_tag("unlock.png", :plugin => "redmine_dmsf"),
"manipulation_link('#{url_for(:action => 'unlock', :id => @project, :folder_id => @folder, :current => request.url)}')",
:title => l(:title_unlock_folder)) unless @folder.nil?%>
<% end %>
<% else %>
<%= link_to_function(image_tag("lock.png", :plugin => "redmine_dmsf"),
"manipulation_link('#{url_for(:action => 'lock', :id => @project, :folder_id => @folder, :current => request.url)}')",
:title => l(:title_lock_folder)) unless @folder.nil?%>
<% end %>
<% end %>
<% if @folder.nil? %>
&nbsp;
<%= link_to("", {:action => "edit_root", :id => @project},
:title => l(:link_edit, :title => l(:link_documents)), :class => "icon icon-edit") %>
<% elsif (!@folder.nil? && !@folder.locked_for_user? ) %>
&nbsp;
<%= link_to("", {:action => "edit", :id => @project, :folder_id => @folder },
:title => l(:link_edit, :title => h(@folder.title)), :class => "icon icon-edit") %>
<% end %>
&nbsp;
<%= link_to("", {:action => "new", :id => @project, :parent_id => @folder },
:title => l(:link_create_folder), :class => "icon icon-add") unless (!@folder.nil? && @folder.locked_for_user?) %>
<% end %>
<% if User.current.allowed_to?(:folder_manipulation, @project) %>
<% if @folder.nil? %>
&nbsp;
<%= link_to('', {:action => 'edit_root', :id => @project},
:title => l(:link_edit, :title => l(:link_documents)), :class => 'icon icon-edit') %>
<% elsif (@folder && !@folder.locked_for_user? ) %>
&nbsp;
<%= link_to('', {:action => 'edit', :id => @project, :folder_id => @folder },
:title => l(:link_edit, :title => h(@folder.title)), :class => 'icon icon-edit') %>
<% end %>
<% if @folder && (!@folder.locked_for_user? || User.current.allowed_to?(:force_file_unlock, @project)) %>
<% if @folder.locked? %>
<% unless @folder.unlockable? %>
<%= image_tag('locked.png', :plugin => :redmine_dmsf, :title => l(:title_folder_parent_locked, :name => @folder.folder.lock.reverse[0].folder.title)) unless @folder.nil?%>
<% else %>
<%= link_to_function(image_tag('unlock.png', :plugin => 'redmine_dmsf'),
"manipulation_link('#{url_for(:action => 'unlock', :id => @project, :folder_id => @folder, :current => request.url)}')",
:title => l(:title_unlock_folder)) if @folder %>
<% end %>
<% else %>
<%= link_to_function(image_tag('lock.png', :plugin => 'redmine_dmsf'),
"manipulation_link('#{url_for(:action => 'lock', :id => @project, :folder_id => @folder, :current => request.url)}')",
:title => l(:title_lock_folder)) if @folder %>
<% end %>
<% end %>
<% unless @folder %>
&nbsp;
<% if @project.dmsf_notification %>
<%= link_to_function(image_tag('notify.png', :plugin => :redmine_dmsf),
"manipulation_link('#{url_for(:action => 'notify_deactivate', :id => @project)}')",
:title => l(:title_notifications_active_deactivate)) %>
<% else %>
<%= link_to_function(image_tag('notifynot.png', :plugin => :redmine_dmsf),
"manipulation_link('#{url_for(:action => 'notify_activate', :id => @project)}')",
:title => l(:title_notifications_not_active_activate)) %>
<% end %>
<% end %>
&nbsp;
<%= link_to('', {:action => 'new', :id => @project, :parent_id => @folder },
:title => l(:link_create_folder), :class => 'icon icon-add') unless (@folder && @folder.locked_for_user?) %>
<% end %>
</div>
<% path = @folder.nil? ? [] : @folder.dmsf_path %>
<h2>
<%= render(:partial => 'path', :locals => {:path => path}) %>
<h2>
<% path = @folder ? @folder.dmsf_path : [] %>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
</h2>
<div class="dmsf-header">
@ -218,13 +234,15 @@
:title => l(:title_waiting_for_approval),
:remote => true) %>
<% else %>
<%= image_tag('waiting_for_approval.png', :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}", :plugin => :redmine_dmsf) %>
<%= image_tag('waiting_for_approval.png', :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}", :plugin => :redmine_dmsf) %>
<% end %>
<% else %>
<%= image_tag('waiting_for_approval.png', :title => "#{l(:label_dmsf_wokflow_action_approve)} #{l(:label_dmsf_wokflow_action_reject)} #{l(:label_dmsf_wokflow_action_delegate)}", :plugin => :redmine_dmsf) %>
<% end %>
<% when DmsfWorkflow::STATE_APPROVED %>
<%= image_tag('approved.png', :title => l(:title_approved), :plugin => :redmine_dmsf) %>
<% when DmsfWorkflow::STATE_ASSIGNED %>
<% if User.current && (file.last_revision.dmsf_workflow_assigned_by == User.current.id) %>
<% if User.current && (file.last_revision.dmsf_workflow_assigned_by == User.current.id) && wf %>
<%= link_to_function(image_tag('assigned.png', :plugin => :redmine_dmsf),
"manipulation_link('#{start_dmsf_workflow_path(
:id => file.last_revision.dmsf_workflow_id,

View File

@ -40,12 +40,16 @@
<%= link_to(image_tag("copy.png"), {:controller => :dmsf_files_copy, :action => "new", :id => @file }, :title => l(:title_copy_or_move)) %>
</div>
<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %>
<h2>
<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %>
/
<%= h(@file.last_revision.title) %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %>
<h2>
<% path = @file.folder ? @file.folder.dmsf_path : [] %>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
/
<%= h(@file.last_revision.title) %>
<%= image_tag('notify.png', :plugin => 'redmine_dmsf', :title => l(:title_notifications_active)) if @file.notification %>
</h2>
<%= error_messages_for("file") %>

View File

@ -3,12 +3,16 @@
<div class="contextual">
</div>
<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %>
<h2>
<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %>
/
<%= link_to(h(@file.title), {:controller => "dmsf_files", :action => "show", :id=> @file}) %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %>
<h2>
<% path = @file.folder ? @file.folder.dmsf_path : [] %>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
/
<%= link_to(h(@file.title), {:controller => "dmsf_files", :action => "show", :id=> @file}) %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %>
</h2>
<% unless DmsfFile.allowed_target_projects_on_copy.blank? %>

View File

@ -3,7 +3,13 @@
<div class="contextual">
</div>
<h2><%= render(:partial => "/dmsf/path", :locals => {:path => @folder.dmsf_path}) %></h2>
<h2>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% @folder.dmsf_path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
</h2>
<% unless DmsfFolder.allowed_target_projects_on_copy.blank? %>
<%= form_tag({:action => "copy_to", :id => @folder}, :id => "copyForm") do |f| %>

View File

@ -1,17 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
deleted DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<p>
<%= h(file.dmsf_path_str) %> (<%= file.name %>),
<%= number_to_human_size(file.last_revision.size) %>,
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
</p>
<% end %>
</body>
</html>
User <%= link_to(h(@user), {:only_path => false, :controller => 'users', :action => 'show', :id => @user }) %>
deleted DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<p>
<%= h(file.dmsf_path_str) %> (<%= file.name %>)
<% if file.last_revision %>
, <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
<% end %>
</p>
<% end %>

View File

@ -1,5 +1,7 @@
User <%= @user %> deleted DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
<%= file.dmsf_path_str %> (<%= file.name %>)
<% if file.last_revision %>
, <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
<% end %>
<% end %>

View File

@ -1,17 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
deleted DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<p>
<%= h(file.dmsf_path_str) %> (<%= file.name %>),
<%= number_to_human_size(file.last_revision.size) %>,
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
</p>
<% end %>
</body>
</html>

View File

@ -1,5 +0,0 @@
User <%= @user %> deleted DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
<% end %>

View File

@ -1,25 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
actualized DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<p>
<%= link_to(h(file.dmsf_path_str),
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file,
:download => ""}) %> (<%= file.name %>),
<%= number_to_human_size(file.last_revision.size) %>,
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>,
<%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %>
<%= link_to("Details",
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %>
<% unless file.last_revision.comment.blank? %>
<br /><span style="font-size: 0.9em">&nbsp;&nbsp;&nbsp;&nbsp;<em><%= h(file.last_revision.comment) %></em></span>
<% end %>
</p>
<% end %>
</body>
</html>
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
actualized DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<p>
<%= link_to(h(file.dmsf_path_str),
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file,
:download => ""}) %> (<%= file.name %>),
<%= number_to_human_size(file.last_revision.size) %>,
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>,
<%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %>
<%= link_to("Details",
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %>
<% unless file.last_revision.comment.blank? %>
<br /><span style="font-size: 0.9em">&nbsp;&nbsp;&nbsp;&nbsp;<em><%= h(file.last_revision.comment) %></em></span>
<% end %>
</p>
<% end %>

View File

@ -1,25 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
actualized DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<p>
<%= link_to(h(file.dmsf_path_str),
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file,
:download => ""}) %> (<%= file.name %>),
<%= number_to_human_size(file.last_revision.size) %>,
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>,
<%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %>
<%= link_to("Details",
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %>
<% unless file.last_revision.comment.blank? %>
<br /><span style="font-size: 0.9em">&nbsp;&nbsp;&nbsp;&nbsp;<em><%= h(file.last_revision.comment) %></em></span>
<% end %>
</p>
<% end %>
</body>
</html>

View File

@ -1,6 +0,0 @@
User <%= @user %> actualized DMSF files in project <%= @project.name %>:
<% @files.each do |file| %>
<%= file.dmsf_path_str %> (<%= file.name %>), <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %><%= ", #{file.last_revision.workflow_str(true)}" unless file.last_revision.workflow_str(true).blank? %>
<%= url_for({:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %>
<% unless file.last_revision.comment.blank? %> comment: <%= file.last_revision.comment %><% end %>
<% end %>

View File

@ -1,15 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<p>Dear user,</p>
<p>
<%= @text1 %>
</p>
<p>
<%= @text2 %>
</p>
</body>
</html>
<p>Dear user,</p>
<p>
<%= @text1 %>
</p>
<p>
<%= @text2 %>
</p>

View File

@ -3,9 +3,13 @@
<div class="contextual">
</div>
<% path = @folder.nil? ? [] : @folder.dmsf_path %>
<h2>
<%= render(:partial => '/dmsf/path', :locals => {:path => path}) %>
<h2>
<% path = @folder ? @folder.dmsf_path : [] %>
<%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<% path.each do |path_element| %>
/
<%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %>
<% end %>
</h2>
<div class="wiki">

View File

@ -1,4 +1,4 @@
<% if @project.new_record? && !@source_project.nil? %>
<% if @project.new_record? && @source_project %>
<p>
<label class="block"><%= check_box_tag 'only[]', 'dmsf', true %><%= l(:label_dmsf_plural, @source_project.dmsf_count) %></label>
</p>

View File

@ -3,8 +3,7 @@ cs:
dmsf: DMSF
label_dmsf_file_plural: Dmsf soubory
warning_no_entries_selected: Není nic vybráno
error_email_to_must_be_entered: Musí být zadán adresát
notice_email_sent: Email byl odeslán
error_email_to_must_be_entered: Musí být zadán adresát
warning_file_already_locked: Soubor už je zamčen
notice_file_locked: Soubor byl zamčen
warning_file_not_locked: Soubor není zamčen

View File

@ -3,8 +3,7 @@ de:
dmsf: DMS
label_dmsf_file_plural: DMS
warning_no_entries_selected: Keine Einträge ausgewählt
error_email_to_must_be_entered: Es muss ein Email-Empfänger angegeben werden.
notice_email_sent: Email gesendet
error_email_to_must_be_entered: Es muss ein Email-Empfänger angegeben werden.
warning_file_already_locked: Datei schon gesperrt
notice_file_locked: Datei gesperrt
warning_file_not_locked: Datei nicht gesperrt

View File

@ -3,8 +3,7 @@ en:
dmsf: DMSF
label_dmsf_file_plural: Dmsf files
warning_no_entries_selected: No entries selected
error_email_to_must_be_entered: Email To must be entered
notice_email_sent: Email sent
error_email_to_must_be_entered: Email To must be entered
warning_file_already_locked: File already locked
notice_file_locked: File locked
warning_file_not_locked: File not locked

View File

@ -3,8 +3,7 @@ es:
dmsf: DMSF
label_dmsf_file_plural: DMSF Archivos
warning_no_entries_selected: No ha seleccionado ningún ítem
error_email_to_must_be_entered: Ingrese un email
notice_email_sent: Email sent
error_email_to_must_be_entered: Ingrese un email
warning_file_already_locked: El archivo ya está bloqueado
notice_file_locked: Archivo bloqueado
warning_file_not_locked: Archivo no bloqueado

View File

@ -3,8 +3,7 @@ fr:
dmsf: DMSF
label_dmsf_file_plural: Fichiers DMSF
warning_no_entries_selected: Aucun fichier sélectionné
error_email_to_must_be_entered: La saisie d'une adresse mail est obligatoire
notice_email_sent: Mail envoyé
error_email_to_must_be_entered: La saisie d'une adresse mail est obligatoire
warning_file_already_locked: Fichier déjà verrouillé
notice_file_locked: Fichier verrouillé
warning_file_not_locked: Fichier déverrouillé

View File

@ -3,8 +3,7 @@ ja:
dmsf: DMSF
label_dmsf_file_plural: Dmsf ファイル
warning_no_entries_selected: エントリーが選ばれていません
error_email_to_must_be_entered: 電子メールの To 先は省略できません
notice_email_sent: 電子メールを送信しました
error_email_to_must_be_entered: 電子メールの To 先は省略できません
warning_file_already_locked: ファイルは既にロックされています
notice_file_locked: ファイルをロックしました
warning_file_not_locked: ファイルはロックされていません

View File

@ -3,8 +3,7 @@ ru:
dmsf: DMSF
label_dmsf_file_plural: Файлы DMSF
warning_no_entries_selected: Файлы не выбраны
error_email_to_must_be_entered: Нужно указать, на какую почту отправить письмо
notice_email_sent: Письмо отправлено
error_email_to_must_be_entered: Нужно указать, на какую почту отправить письмо
warning_file_already_locked: Файл уже заблокирован
notice_file_locked: Файл заблокирован
warning_file_not_locked: Файл не заблокирован

View File

@ -3,8 +3,7 @@ zh:
dmsf: 文档管家
label_dmsf_file_plural: Dmsf files
warning_no_entries_selected: 未选择任何条目
error_email_to_must_be_entered: 请输入电子邮件
notice_email_sent: 邮件已发送
error_email_to_must_be_entered: 请输入电子邮件
warning_file_already_locked: 文件已经锁定
notice_file_locked: 文件锁定
warning_file_not_locked: 文件未锁定

View File

@ -0,0 +1,28 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2013 Karel Picman <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.
class UpdateProjects < ActiveRecord::Migration
def self.up
# DMSF - project's root folder notification
add_column :projects, :dmsf_notification, :boolean
end
def self.down
remove_column :porojects, :dmsf_notification
end
end