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

View File

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

View File

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

View File

@ -122,7 +122,6 @@ class DmsfUploadController < ApplicationController
new_revision.description = commited_file["description"] new_revision.description = commited_file["description"]
new_revision.comment = commited_file["comment"] new_revision.comment = commited_file["comment"]
new_revision.increase_version(commited_file["version"].to_i, true) new_revision.increase_version(commited_file["version"].to_i, true)
#new_revision.set_workflow(commited_file[:dmsf_workflow_id], nil)
new_revision.mime_type = Redmine::MimeType.of(new_revision.name) new_revision.mime_type = Redmine::MimeType.of(new_revision.name)
new_revision.size = File.size(commited_disk_filepath) new_revision.size = File.size(commited_disk_filepath)
@ -134,8 +133,13 @@ class DmsfUploadController < ApplicationController
end end
if file.locked? if file.locked?
file.unlock! begin
flash[:notice] = l(:notice_file_unlocked) file.unlock!
flash[:notice] = l(:notice_file_unlocked)
rescue DmsfLockError => e
flash[:error] = e.message
next
end
end end
# Need to save file first to generate id for it in case of creation. # 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 end
def title def title
self.last_revision.title self.last_revision ? self.last_revision.title : self.name
end end
def description def description
self.last_revision.description self.last_revision ? self.last_revision.description : ''
end end
def version def version
self.last_revision.version self.last_revision ? self.last_revision.version : '0'
end end
def workflow def workflow
self.last_revision.workflow self.last_revision ? self.last_revision.workflow : nil
end end
def size def size
self.last_revision.size self.last_revision ? self.last_revision.size : 0
end end
def dmsf_path def dmsf_path
@ -151,14 +151,13 @@ class DmsfFile < ActiveRecord::Base
end end
def dmsf_path_str def dmsf_path_str
path = self.dmsf_path self.dmsf_path.map { |element| element.title }.join('/')
string_path = path.map { |element| element.title }
string_path.join("/")
end end
def notify? def notify?
return true if self.notification return true if self.notification
return true if folder && folder.notify? return true if folder && folder.notify?
return true if !folder && self.project.dmsf_notification
return false return false
end end

View File

@ -115,6 +115,7 @@ class DmsfFolder < ActiveRecord::Base
def notify? def notify?
return true if self.notification return true if self.notification
return true if folder && folder.notify? return true if folder && folder.notify?
return true if !folder && self.project.dmsf_notification
return false return false
end 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 create = @pathfolder == @parent
%> %>
<h2> <h2>
<%= render(:partial => "path", :locals => {:path => @pathfolder.nil? ? [] : @pathfolder.dmsf_path}) %> <% path = @pathfolder ? @pathfolder.dmsf_path : [] %>
<%= ("/ " + l(:heading_new_folder)) if create %> <%= 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> </h2>
<%= form_for(@folder, :url => {:action => create ? "create" : "save", :id => @project, :folder_id => @folder, :parent_id => @parent}, <%= 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 class="contextual">
</div> </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}, <%= form_for(@project, :url => {:action => 'save_root', :id => @project},
:html => {:method=>:post}) do |f| %> :html => {:method=>:post}) do |f| %>
<div class="box dmsf_detail"> <div class="box dmsf_detail">
<p class="no-ident"> <p class="no-ident">
<%= label_tag("project_dmsf_description", l(:label_description) + ":") %> <%= label_tag('project_dmsf_description', "#{l(:label_description)}:") %>
</p> </p>
<div class="wiki data clear"> <div class="wiki data clear">
<%= f.text_area(:dmsf_description, :rows => 15, :class => "wiki-edit") %> <%= f.text_area(:dmsf_description, :rows => 15, :class => 'wiki-edit') %>
</div> </div>
</div> </div>
<%= submit_tag(l(:submit_save)) %> <%= submit_tag(l(:submit_save)) %>
<% end %> <% end %>
<%= wikitoolbar_for "dmsf_folder_description" %> <%= wikitoolbar_for 'dmsf_folder_description' %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %> <%= stylesheet_link_tag 'dmsf', :plugin => 'redmine_dmsf' %>
<% end %> <% end %>

View File

@ -3,9 +3,13 @@
<div class="contextual"> <div class="contextual">
</div> </div>
<% path = @folder.nil? ? [] : @folder.dmsf_path %>
<h2> <h2>
<%= render(:partial => 'path', :locals => {:path => path}) %> <% 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> </h2>
<h3><%= l(:heading_send_documents_by_email) %></h3> <h3><%= l(:heading_send_documents_by_email) %></h3>

View File

@ -1,40 +1,56 @@
<% html_title(l(:dmsf)) %> <% html_title(l(:dmsf)) %>
<div class="contextual"> <div class="contextual">
<% if User.current.allowed_to?(:folder_manipulation, @project) %> <% 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.nil? %>
<% if @folder.locked? %> &nbsp;
<% unless @folder.unlockable? %> <%= link_to('', {:action => 'edit_root', :id => @project},
<%= image_tag("locked.png", :plugin => :redmine_dmsf, :title => l(:title_folder_parent_locked, :name => @folder.folder.lock.reverse[0].folder.title)) unless @folder.nil?%> :title => l(:link_edit, :title => l(:link_documents)), :class => 'icon icon-edit') %>
<% else %> <% elsif (@folder && !@folder.locked_for_user? ) %>
<%= link_to_function(image_tag("unlock.png", :plugin => "redmine_dmsf"), &nbsp;
"manipulation_link('#{url_for(:action => 'unlock', :id => @project, :folder_id => @folder, :current => request.url)}')", <%= link_to('', {:action => 'edit', :id => @project, :folder_id => @folder },
:title => l(:title_unlock_folder)) unless @folder.nil?%> :title => l(:link_edit, :title => h(@folder.title)), :class => 'icon icon-edit') %>
<% end %> <% end %>
<% else %> <% if @folder && (!@folder.locked_for_user? || User.current.allowed_to?(:force_file_unlock, @project)) %>
<%= link_to_function(image_tag("lock.png", :plugin => "redmine_dmsf"), <% if @folder.locked? %>
"manipulation_link('#{url_for(:action => 'lock', :id => @project, :folder_id => @folder, :current => request.url)}')", <% unless @folder.unlockable? %>
:title => l(:title_lock_folder)) unless @folder.nil?%> <%= image_tag('locked.png', :plugin => :redmine_dmsf, :title => l(:title_folder_parent_locked, :name => @folder.folder.lock.reverse[0].folder.title)) unless @folder.nil?%>
<% end %> <% else %>
<% end %> <%= link_to_function(image_tag('unlock.png', :plugin => 'redmine_dmsf'),
<% if @folder.nil? %> "manipulation_link('#{url_for(:action => 'unlock', :id => @project, :folder_id => @folder, :current => request.url)}')",
&nbsp; :title => l(:title_unlock_folder)) if @folder %>
<%= link_to("", {:action => "edit_root", :id => @project}, <% end %>
:title => l(:link_edit, :title => l(:link_documents)), :class => "icon icon-edit") %> <% else %>
<% elsif (!@folder.nil? && !@folder.locked_for_user? ) %> <%= link_to_function(image_tag('lock.png', :plugin => 'redmine_dmsf'),
&nbsp; "manipulation_link('#{url_for(:action => 'lock', :id => @project, :folder_id => @folder, :current => request.url)}')",
<%= link_to("", {:action => "edit", :id => @project, :folder_id => @folder }, :title => l(:title_lock_folder)) if @folder %>
:title => l(:link_edit, :title => h(@folder.title)), :class => "icon icon-edit") %> <% end %>
<% end %> <% end %>
&nbsp; <% unless @folder %>
<%= link_to("", {:action => "new", :id => @project, :parent_id => @folder }, &nbsp;
:title => l(:link_create_folder), :class => "icon icon-add") unless (!@folder.nil? && @folder.locked_for_user?) %> <% if @project.dmsf_notification %>
<% end %> <%= 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> </div>
<% path = @folder.nil? ? [] : @folder.dmsf_path %>
<h2> <h2>
<%= render(:partial => 'path', :locals => {:path => path}) %> <% 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> </h2>
<div class="dmsf-header"> <div class="dmsf-header">
@ -220,11 +236,13 @@
<% else %> <% 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 %> <% 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 %> <% end %>
<% when DmsfWorkflow::STATE_APPROVED %> <% when DmsfWorkflow::STATE_APPROVED %>
<%= image_tag('approved.png', :title => l(:title_approved), :plugin => :redmine_dmsf) %> <%= image_tag('approved.png', :title => l(:title_approved), :plugin => :redmine_dmsf) %>
<% when DmsfWorkflow::STATE_ASSIGNED %> <% 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), <%= link_to_function(image_tag('assigned.png', :plugin => :redmine_dmsf),
"manipulation_link('#{start_dmsf_workflow_path( "manipulation_link('#{start_dmsf_workflow_path(
:id => file.last_revision.dmsf_workflow_id, :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)) %> <%= link_to(image_tag("copy.png"), {:controller => :dmsf_files_copy, :action => "new", :id => @file }, :title => l(:title_copy_or_move)) %>
</div> </div>
<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %>
<h2> <h2>
<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %> <% path = @file.folder ? @file.folder.dmsf_path : [] %>
/ <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %>
<%= h(@file.last_revision.title) %> <% path.each do |path_element| %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %> /
<%= 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> </h2>
<%= error_messages_for("file") %> <%= error_messages_for("file") %>

View File

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

View File

@ -3,7 +3,13 @@
<div class="contextual"> <div class="contextual">
</div> </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? %> <% unless DmsfFolder.allowed_target_projects_on_copy.blank? %>
<%= form_tag({:action => "copy_to", :id => @folder}, :id => "copyForm") do |f| %> <%= 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"> User <%= link_to(h(@user), {:only_path => false, :controller => 'users', :action => 'show', :id => @user }) %>
<html> deleted DMSF files in project <%= @project.name %>:
<head> <% @files.each do |file| %>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <p>
</head> <%= h(file.dmsf_path_str) %> (<%= file.name %>)
<body> <% if file.last_revision %>
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> , <%= number_to_human_size(file.last_revision.size) %>, version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>
deleted DMSF files in project <%= @project.name %>: <% end %>
<% @files.each do |file| %> </p>
<p> <% end %>
<%= 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 +1,7 @@
User <%= @user %> deleted DMSF files in project <%= @project.name %>: User <%= @user %> deleted DMSF files in project <%= @project.name %>:
<% @files.each do |file| %> <% @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 %> <% 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"> User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %>
<html> actualized DMSF files in project <%= @project.name %>:
<head> <% @files.each do |file| %>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <p>
</head> <%= link_to(h(file.dmsf_path_str),
<body> {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file,
User <%= link_to(h(@user), {:only_path => false, :controller => "users", :action => "show", :id => @user }) %> :download => ""}) %> (<%= file.name %>),
actualized DMSF files in project <%= @project.name %>: <%= number_to_human_size(file.last_revision.size) %>,
<% @files.each do |file| %> version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>,
<p> <%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %>
<%= link_to(h(file.dmsf_path_str), <%= link_to("Details",
{:only_path => false, :controller => "dmsf_files", :action => "show", :id => file, {:only_path => false, :controller => "dmsf_files", :action => "show", :id => file}) %>
:download => ""}) %> (<%= file.name %>), <% unless file.last_revision.comment.blank? %>
<%= number_to_human_size(file.last_revision.size) %>, <br /><span style="font-size: 0.9em">&nbsp;&nbsp;&nbsp;&nbsp;<em><%= h(file.last_revision.comment) %></em></span>
version: <%= file.last_revision.major_version %>.<%= file.last_revision.minor_version %>, <% end %>
<%= "#{file.last_revision.workflow_str(true)}," unless file.last_revision.workflow_str(true).blank? %> </p>
<%= link_to("Details", <% end %>
{: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,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"> <p>Dear user,</p>
<html> <p>
<head> <%= @text1 %>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> </p>
</head> <p>
<body> <%= @text2 %>
<p>Dear user,</p> </p>
<p>
<%= @text1 %>
</p>
<p>
<%= @text2 %>
</p>
</body>
</html>

View File

@ -3,9 +3,13 @@
<div class="contextual"> <div class="contextual">
</div> </div>
<% path = @folder.nil? ? [] : @folder.dmsf_path %>
<h2> <h2>
<%= render(:partial => '/dmsf/path', :locals => {:path => path}) %> <% 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> </h2>
<div class="wiki"> <div class="wiki">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,6 @@ zh:
label_dmsf_file_plural: Dmsf files label_dmsf_file_plural: Dmsf files
warning_no_entries_selected: 未选择任何条目 warning_no_entries_selected: 未选择任何条目
error_email_to_must_be_entered: 请输入电子邮件 error_email_to_must_be_entered: 请输入电子邮件
notice_email_sent: 邮件已发送
warning_file_already_locked: 文件已经锁定 warning_file_already_locked: 文件已经锁定
notice_file_locked: 文件锁定 notice_file_locked: 文件锁定
warning_file_not_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